From: "marcandre (Marc-Andre Lafortune)" Date: 2013-03-30T13:34:03+09:00 Subject: [ruby-core:53839] [ruby-trunk - Bug #8188][Open] Wrong warning about __attached__ Issue #8188 has been reported by marcandre (Marc-Andre Lafortune). ---------------------------------------- Bug #8188: Wrong warning about __attached__ https://bugs.ruby-lang.org/issues/8188 Author: marcandre (Marc-Andre Lafortune) Status: Open Priority: Low Assignee: Category: core Target version: current: 2.1.0 ruby -v: ruby 2.1.0dev (2013-03-30) ruby -w -e "ARGF.singleton_class.instance_eval{}" # => warning: instance variable __attached__ not initialized Here's the test, but I'm not sure how to fix. Should rb_ivar_get(..., id_attached) replaced with rb_attr_get? ``` diff --git a/test/ruby/test_eval.rb b/test/ruby/test_eval.rb index 580d3e8..8e3bd8c 100644 --- a/test/ruby/test_eval.rb +++ b/test/ruby/test_eval.rb @@ -215,6 +215,12 @@ class TestEval < Test::Unit::TestCase end end + def test_instance_eval_on_argf_singleton_class + assert_warning('', '[ruby-core:xxx]') do + ARGF.singleton_class.instance_eval{} + end + end + class Foo Bar = 2 end ``` -- http://bugs.ruby-lang.org/