diff options
author | Koichi Sasada <[email protected]> | 2019-10-25 04:01:02 +0900 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2019-10-25 04:01:02 +0900 |
commit | e8f90e73978c0321021c177fe3fa2623a8b3a4de (patch) | |
tree | 79eb53cc77a91e5ba8a14879ed8ea611983d91fb | |
parent | b7c8874b6290d17f6f8ebd4b2fa72c231121c714 (diff) |
check T_ICLASS for Method#inspect.
METHOD::klass can contain T_ICLASS so inspect should respect it.
-rw-r--r-- | proc.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -2819,6 +2819,14 @@ method_inspect(VALUE method) mklass = data->klass; + if (RB_TYPE_P(mklass, T_ICLASS)) { + /* TODO: I'm not sure why mklass is T_ICLASS. + * UnboundMethod#bind() can set it as T_ICLASS at convert_umethod_to_method_components() + * but not sure it is needed. + */ + mklass = RBASIC_CLASS(mklass); + } + if (data->me->def->type == VM_METHOD_TYPE_ALIAS) { defined_class = data->me->def->body.alias.original_me->owner; } |