Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make $obj.RoleName::method() calls work.
  • Loading branch information
jnthn committed May 8, 2010
1 parent 30ac13b commit b52bbee
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/glue/dispatch.pir
Expand Up @@ -272,8 +272,15 @@ Helper for handling calls of the form .Foo::bar.
.param pmc named_args :slurpy :named
$I0 = target.'ACCEPTS'(invocant)
unless $I0 goto not_allowed
$I0 = isa target, 'Perl6Role'
if $I0 goto method_from_role
$P0 = find_method target, name
.tailcall $P0(invocant, pos_args :flat, named_args :flat :named)
method_from_role:
$P0 = target.'HOW'()
$P0 = $P0.'methods'(target)
$P0 = $P0[name]
.tailcall $P0(invocant, pos_args :flat, named_args :flat :named)
not_allowed:
$S0 = "Can not call method '"
concat $S0, name
Expand Down

0 comments on commit b52bbee

Please sign in to comment.