mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
check T_ICLASS for Method#inspect.
METHOD::klass can contain T_ICLASS so inspect should respect it.
This commit is contained in:
parent
b7c8874b62
commit
e8f90e7397
1 changed files with 8 additions and 0 deletions
8
proc.c
8
proc.c
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue