From 3041c43df15bd895c41860930332579b80f7d68e Mon Sep 17 00:00:00 2001 From: nagachika Date: Thu, 12 Sep 2013 15:54:50 +0000 Subject: merge revision(s) 42869: [Backport #8872] * vm_eval.c (vm_call0): fix prototype, the id parameter should be of type ID, not VALUE * vm_insnhelper.c (check_match): the rb_funcall family of functions does not care about refinements. We need to use rb_method_entry_with_refinements instead to call === with refinements. Thanks to Jon Conley for reporting this bug. [ruby-core:57051] [Bug #8872] * test/ruby/test_refinement.rb: add test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@42923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_refinement.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test') diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb index 23b73667a7..b6bdc9430f 100644 --- a/test/ruby/test_refinement.rb +++ b/test/ruby/test_refinement.rb @@ -826,6 +826,27 @@ class TestRefinement < Test::Unit::TestCase assert_equal([:foo, :ref, bug7925], x, bug7925) end + def test_case_dispatch_is_aware_of_refinements + assert_in_out_err([], <<-RUBY, ["refinement used"], ["-:2: warning: Refinements are experimental, and the behavior may change in future versions of Ruby!"]) + module RefineSymbol + refine Symbol do + def ===(other) + true + end + end + end + + using RefineSymbol + + case :a + when :b + puts "refinement used" + else + puts "refinement not used" + end + RUBY + end + private def eval_using(mod, s) -- cgit v1.2.3