Actions
Bug #10299
closedalias_method :new_foo=, :"#{:foo}=" doesn't work properly on ruby 2.2.0preview1.
Description
Here is reproducible script.
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.
Updated by nobu (Nobuyoshi Nakada) about 10 years ago
- Is duplicate of Bug #10259: send を使った attr_writer への書き込みができない場合がある added
Updated by nobu (Nobuyoshi Nakada) about 10 years ago
- Is duplicate of Bug #10283: Calling define_method with a dynamic symbol ending in = results in a NoMethodError when calling the method via assignment, until called via send added
Updated by nobu (Nobuyoshi Nakada) about 10 years ago
- Status changed from Open to Closed
- Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN to 2.0.0: DONTNEED, 2.1: DONTNEED
Actions
Like0
Like0Like0Like0