Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save udzura/02a6763a22601cdea7f3e4c9c9fe46a4 to your computer and use it in GitHub Desktop.
Save udzura/02a6763a22601cdea7f3e4c9c9fe46a4 to your computer and use it in GitHub Desktop.
From d2740fe5956726c787ce29ecf85a51a0b44a9bbd Mon Sep 17 00:00:00 2001
From: Uchio Kondo <[email protected]>
Date: Mon, 17 Mar 2025 11:51:25 +0900
Subject: [PATCH] Revert "Clear all refined CCs on reopening refinement mod"
This reverts commit 18ee7c9a108bf3424814565377c8796e5e455cf7.
---
test/ruby/test_refinement.rb | 17 -----------------
vm_method.c | 1 -
2 files changed, 18 deletions(-)
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb
index d081bc9127..826616eb09 100644
--- a/test/ruby/test_refinement.rb
+++ b/test/ruby/test_refinement.rb
@@ -1606,35 +1606,18 @@ def m
end
using R
- def m
- C.new.m
- end
-
assert_equal(:foo, C.new.m)
- assert_equal(:foo, m)
module R
refine C do
-
- assert_equal(:foo, C.new.m)
- assert_equal(:foo, m)
-
alias m m
-
- assert_equal(:foo, C.new.m)
- assert_equal(:foo, m)
-
def m
:bar
end
-
- assert_equal(:bar, C.new.m, "[ruby-core:71423] [Bug #11672]")
- assert_equal(:bar, m, "[Bug #20285]")
end
end
assert_equal(:bar, C.new.m, "[ruby-core:71423] [Bug #11672]")
- assert_equal(:bar, m, "[Bug #20285]")
end;
end
diff --git a/vm_method.c b/vm_method.c
index 7b57b56cd6..5b5f43fdbb 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -301,7 +301,6 @@ rb_clear_method_cache(VALUE klass_or_module, ID mid)
VALUE refined_class = rb_refinement_module_get_refined_class(module);
rb_clear_method_cache(refined_class, mid);
rb_class_foreach_subclass(refined_class, clear_iclass_method_cache_by_id_for_refinements, mid);
- rb_clear_all_refinement_method_cache();
}
rb_class_foreach_subclass(module, clear_iclass_method_cache_by_id, mid);
}
--
2.39.5 (Apple Git-154)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment