[#69084] [Ruby trunk - Feature #11124] [Open] [PATCH] lib/*: use monotonic clock for timeouts — normalperson@...
Issue #11124 has been reported by Eric Wong.
5 messages
2015/05/06
[#69138] [Ruby trunk - Feature #11136] [PATCH] webrick: avoid fcntl module — nobu@...
Issue #11136 has been updated by Nobuyoshi Nakada.
3 messages
2015/05/12
[#69160] [Ruby trunk - Feature #11146] [PATCH] variable.c: initialize generic_iv_tbl at start — nobu@...
Issue #11146 has been updated by Nobuyoshi Nakada.
4 messages
2015/05/13
[#69175] Re: [Ruby trunk - Feature #11146] [PATCH] variable.c: initialize generic_iv_tbl at start
— Eric Wong <normalperson@...>
2015/05/13
nobu@ruby-lang.org wrote:
[ruby-core:69249] [Ruby trunk - Bug #11086] Symbol#instance_eval gives 'TypeError: can't define singleton' when coerced with String#to_sym
From:
nagachika00@...
Date:
2015-05-20 15:52:01 UTC
List:
ruby-core #69249
Issue #11086 has been updated by Tomoyuki Chikanaga.
Backport changed from 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONE
Backported into `ruby_2_2` branch at r50561.
----------------------------------------
Bug #11086: Symbol#instance_eval gives 'TypeError: can't define singleton' when coerced with String#to_sym
https://bugs.ruby-lang.org/issues/11086#change-52502
* Author: Thijs Wouters
* Status: Closed
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
* Backport: 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONE
----------------------------------------
When I coerce a String into a Symbol with String#to_sym, a call to Symbol#instance_eval fails with 'TypeError: can't define singleton'. If I first define the Symbol, it works as expected.
Failure:
~~~
2.2.1 :001 > "test_symbol".to_sym.instance_eval{true}
TypeError: can't define singleton
from (irb):1:in `instance_eval'
from (irb):1
from /home/xxx/.rvm/rubies/ruby-2.2.1/bin/irb:11:in `<main>'
2.2.1 :002 > :test_symbol.instance_eval{true}
TypeError: can't define singleton
from (irb):2:in `instance_eval'
from (irb):2
from /home/xxx/.rvm/rubies/ruby-2.2.1/bin/irb:11:in `<main>'
2.2.1 :003 > exit
~~~
Other way around:
~~~
2.2.1 :001 > :test_symbol.instance_eval{true}
=> true
2.2.1 :002 > "test_symbol".to_sym.instance_eval{true}
=> true
2.2.1 :003 > exit
~~~
This also fails in 2.2.0, but does not in 2.1.5.
---Files--------------------------------
test.patch (444 Bytes)
--
https://bugs.ruby-lang.org/