Actions
Bug #10259
closedsend を使った attr_writer への書き込みができない場合がある
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)
Updated by mtsmfm (Fumiaki Matsushima) over 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
Like0
Like0Like0Like0Like0