Project

General

Profile

Actions

Bug #10259

closed

send を使った attr_writer への書き込みができない場合がある

Added by mtsmfm (Fumiaki Matsushima) about 10 years ago. Updated about 10 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
2.2.0dev, 2.2.0-preview1
[ruby-dev:48559]

Description

class Hoge; attr_writer :a; end

Hoge.new.send(:"#{:a}=", 1)
# => 1 (ruby 2.1.2)
# hoge.rb:3:in `<main>': undefined method `a=' (ruby 2.2.0-preview1)

Related issues 2 (0 open2 closed)

Related to 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
Has duplicate Ruby master - Bug #10299: alias_method :new_foo=, :"#{:foo}=" doesn't work properly on ruby 2.2.0preview1.Closed09/27/2014Actions

Updated by mtsmfm (Fumiaki Matsushima) about 10 years ago

ruby 2.2.0dev (2014-09-19 trunk 47640) [x86_64-linux] でも
ruby 2.2.0-preview1 同様に例外が発生することを確認しました。

Updated by nobu (Nobuyoshi Nakada) about 10 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r47643.


symbol.c: fix dynamic attrset ID

  • symbol.c (rb_str_dynamic_intern): check if the stem ID of
    attrset ID is already registered as a static ID.
    [ruby-dev:48559] [Bug #10259]

Updated by nobu (Nobuyoshi Nakada) about 10 years ago

  • Related to 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

  • Has duplicate Bug #10299: alias_method :new_foo=, :"#{:foo}=" doesn't work properly on ruby 2.2.0preview1. added
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0