Project

General

Profile

Bug #10299

alias_method :new_foo=, :"#{:foo}=" doesn't work properly on ruby 2.2.0preview1.

Added by hbd225 (Norimasa Ando) over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
ruby -v:
ruby 2.2.0preview1 (2014-09-17 trunk 47616) [x86_64-darwin12.0]
[ruby-core:65290]

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.


Related issues

Is duplicate of Ruby master - Bug #10259: send を使った attr_writer への書き込みができない場合があるClosed09/18/2014Actions
Is duplicate of Ruby master - Bug #10283: Calling define_method with a dynamic symbol ending in = results in a NoMethodError when calling the method via assignment, until called via sendClosed09/22/2014Actions

Updated by nobu (Nobuyoshi Nakada) over 5 years ago

  • Is duplicate of Bug #10259: send を使った attr_writer への書き込みができない場合がある added

Updated by nobu (Nobuyoshi Nakada) over 5 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) over 5 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

Also available in: Atom PDF