Project

General

Profile

Bug #15720 ยป sse-unused-refinement.patch

jeremyevans0 (Jeremy Evans), 06/10/2019 10:56 PM

View differences:

test/ruby/test_refinement.rb
2242 2242
    INPUT
2243 2243
  end
2244 2244

  
2245
  def test_refining_module_repeatedly
2246
    bug15720 = '[ruby-core:91916] [Bug #15720]'
2247
    assert_in_out_err([], <<-INPUT, ["ok"], [], bug15720)
2248
      module M1
2249
        refine Kernel do
2250
          def foo
2251
            'foo called!'
2252
          end
2253
        end
2254
      end
2255

  
2256
      module M2
2257
        refine Kernel do
2258
          def bar
2259
            'bar called!'
2260
          end
2261
        end
2262
      end
2263

  
2264
      using M1
2265

  
2266
      foo
2267

  
2268
      begin
2269
        bar
2270
      rescue NameError
2271
      end
2272

  
2273
      puts "ok"
2274
    INPUT
2275
  end
2276

  
2245 2277
  def test_super_from_refined_module
2246 2278
    a = EnvUtil.labeled_module("A") do
2247 2279
      def foo;"[A#{super}]";end
vm_insnhelper.c
2635 2635
		    goto no_refinement_dispatch;
2636 2636
		}
2637 2637
	    }
2638
	    cc->me = ref_me;
2638
            if (cc->me->def->type != VM_METHOD_TYPE_REFINED ||
2639
                 cc->me->def != ref_me->def) {
2640
                 cc->me = ref_me;
2641
            }
2639 2642
	    if (ref_me->def->type != VM_METHOD_TYPE_REFINED) {
2640 2643
		return vm_call_method(ec, cfp, calling, ci, cc);
2641 2644
	    }
2642
-