Browse files

Fixes to make sure dispatches on proto-objects work correctly; resolv…

…es RT#62894.
  • Loading branch information...
1 parent 7b4118d commit d668ca982f17170b2301c7da37475c98b8b1cbcf @jnthn jnthn committed Feb 11, 2009
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/classes/ClassHOW.pir
@@ -47,9 +47,17 @@ Dispatches to method of the given name on this class or one of its parents.
.param pmc pos_args :slurpy
.param pmc name_args :slurpy :named
- # Get MRO and an interator on it.
+ # Get MRO and an interator on it. Note that we need to handle calls on
+ # protos a little specially, since parrotclass on them doesn't hand back
+ # the class with the methods in it that we got from the proto.
.local pmc parrotclass, mro, mro_it, cur_class, methods, candidate
+ $I0 = isa obj, 'P6protoobject'
+ if $I0 goto is_proto
parrotclass = getattribute self, 'parrotclass'
+ goto proto_done
+ is_proto:
+ parrotclass = class obj
+ proto_done:
mro = inspect parrotclass, 'all_parents'
mro_it = iter mro

0 comments on commit d668ca9

Please sign in to comment.