diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-08 04:44:51 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-08 04:44:51 +0000 |
commit | bbd662c8bd85e44957c96d40e4291631554c9b5b (patch) | |
tree | a59f1fed74ba4b8c2de1fada66f01edd0c333547 /test/ruby/test_refinement.rb | |
parent | 0a764c0bb18d5b55f14e02ce6376c6c90734817e (diff) |
* insns.def (setclassvariable, setconstant): warn when self is a
refinement. [Bug #10103] [ruby-core:64143]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_refinement.rb')
-rw-r--r-- | test/ruby/test_refinement.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb index 13f2d7a353..5980280235 100644 --- a/test/ruby/test_refinement.rb +++ b/test/ruby/test_refinement.rb @@ -1674,6 +1674,22 @@ class TestRefinement < Test::Unit::TestCase assert_equal [ref::RefB, ref::RefA], ref::Combined::USED_REFS end + def test_warn_setconst_in_refinmenet + bug10103 = '[ruby-core:64143] [Bug #10103]' + warnings = [ + "-:3: warning: not defined at the refinement, but at the outer class/module", + "-:4: warning: not defined at the refinement, but at the outer class/module" + ] + assert_in_out_err([], <<-INPUT, [], warnings, bug10103) + module M + refine String do + FOO = 123 + @@foo = 456 + end + end + INPUT + end + private def eval_using(mod, s) |