Issue #12930 has been updated by Nobuyoshi Nakada.

Status changed from Open to Assigned
Assignee changed from Nobuyoshi Nakada to Yukihiro Matsumoto

A string literal with `.freeze` reveals the object in the shared frozen string literal pool.
I think that shared objects should not be modified, like `Integer` and `Float`.
Any idea?

----------------------------------------
Bug #12930: instance_eval, instance_exec raises TypeError on a frozen String
https://bugs.ruby-lang.org/issues/12930#change-61481

* Author: Akira Matsuda
* Status: Assigned
* Priority: Normal
* Assignee: Yukihiro Matsumoto
* ruby -v: ruby 2.4.0dev (2016-11-13 trunk 56767) [x86_64-darwin15]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
~~~
% ruby -ve 'p "".freeze.instance_eval "size"'
ruby 2.4.0dev (2016-11-13 trunk 56767) [x86_64-darwin15]
-e:1:in `instance_eval': can't define singleton (TypeError)
~~~

since 56747



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>