summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-22 08:29:02 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-22 08:29:02 +0000
commit16a642c3315832992b2af401a45b02451c23f165 (patch)
tree1174cbabea6aa7eadff084d2df8a110707d8b12f /vm_method.c
parent633fef6dec9f078d7c02b737a76f3aad0ba5ccc8 (diff)
Enable refinements at Object#respond_to?
[Feature #15327] [Fix GH-2020] From: osyo-manga <manga.osyo@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/vm_method.c b/vm_method.c
index c4f41bc118..0aeac2869e 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -1089,7 +1089,14 @@ rb_export_method(VALUE klass, ID name, rb_method_visibility_t visi)
int
rb_method_boundp(VALUE klass, ID id, int ex)
{
- const rb_method_entry_t *me = rb_method_entry_without_refinements(klass, id, NULL);
+ const rb_method_entry_t *me;
+
+ if (ex & BOUND_RESPONDS) {
+ me = method_entry_resolve_refinement(klass, id, TRUE, NULL);
+ }
+ else {
+ me = rb_method_entry_without_refinements(klass, id, NULL);
+ }
if (me != 0) {
if ((ex & ~BOUND_RESPONDS) &&