From: Shugo Maeda Date: 2010-02-24T10:10:42+09:00 Subject: [ruby-core:28324] [Bug #2788] nil.instance_eval pushes nil onto cref Bug #2788: nil.instance_eval pushes nil onto cref http://redmine.ruby-lang.org/issues/show/2788 Author: Shugo Maeda Status: Assigned, Priority: Low Assigned to: Yukihiro Matsumoto, Category: core ruby -v: ruby 1.9.2dev (2010-02-18 trunk 26704) [i686-linux] A singleton class definition of nil pushes NilClass onto cref. It is reasonable because NilClass has nil as the only instance. However, nil.instance_eval pushes nil onto cref, which means that method definitions are not permitted in that context. defiant:ruby$ ruby-trunk -ve 'class <': no class/module to add method (TypeError) from -e:1:in `instance_eval' from -e:1:in `
' The behavior is the same in Ruby 1.8.7. Is it intended or a bug? ---------------------------------------- http://redmine.ruby-lang.org