class.c: suppress wrong warning

* class.c (HAVE_METACLASS_P): should check FL_SINGLTON flag before get
  instance variable to get rid of wrong warning about __attached__.
  [ruby-core:53839] [Bug #8188]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-03-30 21:27:27 +00:00
parent b5583577d4
commit c5fe7eb6f6
3 changed files with 22 additions and 1 deletions

View file

@ -215,6 +215,13 @@ class TestEval < Test::Unit::TestCase
end
end
def test_instance_eval_on_argf_singleton_class
bug8188 = '[ruby-core:53839] [Bug #8188]'
assert_warning('', bug8188) do
ARGF.singleton_class.instance_eval{}
end
end
class Foo
Bar = 2
end