From: nobu@... Date: 2014-09-27T12:30:42+00:00 Subject: [ruby-core:65294] [ruby-trunk - Bug #10299] [Closed] alias_method :new_foo=, :"#{:foo}=" doesn't work properly on ruby 2.2.0preview1. Issue #10299 has been updated by Nobuyoshi Nakada. Status changed from Open to Closed Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN to 2.0.0: DONTNEED, 2.1: DONTNEED ---------------------------------------- Bug #10299: alias_method :new_foo=, :"#{:foo}=" doesn't work properly on ruby 2.2.0preview1. https://bugs.ruby-lang.org/issues/10299#change-49118 * Author: Norimasa Ando * Status: Closed * Priority: Normal * Assignee: * Category: * Target version: current: 2.2.0 * ruby -v: ruby 2.2.0preview1 (2014-09-17 trunk 47616) [x86_64-darwin12.0] * Backport: 2.0.0: DONTNEED, 2.1: DONTNEED ---------------------------------------- Here is reproducible script. ~~~ruby class Test class << self def test alias_method :new_foo=, :"#{:foo}=" end end attr_accessor :foo test end ~~~ It occurs following error. ~~~ NameError: undefined method `foo=' for class `Test' from /Users/ando_norimasa/a.rb:4:in `alias_method' ~~~ I expect it works without error. -- https://bugs.ruby-lang.org/