Skip to content

Commit

Permalink
We need to be a little careful when auto-threading ~~ to make sure we…
Browse files Browse the repository at this point in the history
… can still do $x ~~ Jonction and have it be a type-check. I'm quite hopeful this hack can go away when we are using the Perl 6 multi-dispatch algorithm; either way, this makes it work now and lets us add a test so we don't miss it when we make that switch.
  • Loading branch information
jnthn committed Mar 17, 2009
1 parent 285279b commit 90c8b8e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/classes/Junction.pir
Expand Up @@ -459,10 +459,16 @@ a property.
.sub 'infix:~~' :multi('Junction', _)
.param pmc topic
.param pmc x
$I0 = isa x, 'Junction'
unless $I0 goto not_proto_rhs
$I0 = isa x, 'P6protoobject'
if $I0 goto dispatch_on_rhs
not_proto_rhs:
.tailcall '!DISPATCH_JUNCTION'('infix:~~', topic, x)
dispatch_on_rhs:
.tailcall x.'ACCEPTS'(topic)
.end
=back
=cut
Expand Down

0 comments on commit 90c8b8e

Please sign in to comment.