Skip to content
Permalink
Browse files

Additional fix for problem related to R#2514

Spotted while writing tests.
  • Loading branch information...
lizmat committed Dec 5, 2018
1 parent 99d94db commit 9f5cc8d1bae04c1af30bc97452e8465c7e2bb218
Showing with 28 additions and 3 deletions.
  1. +28 −3 src/core/set_intersection.pm6
@@ -130,9 +130,34 @@ multi sub infix:<(&)>(Failure:D $a, Any $) { $a.throw }
# Note that we cannot create a Setty:D,Any candidate because that will result
# in an ambiguous dispatch, so we need to hack a check for Setty in here.
multi sub infix:<(&)>(Any $a, Any $b) {
infix:<(&)>(
nqp::istype($a,Setty) && nqp::isconcrete($a) ?? $a !! $a.Set,
$b.Set
nqp::if(
nqp::isconcrete($a),
nqp::if(
nqp::istype($a,Mixy),
infix:<(&)>($a, $b.Mix),
nqp::if(
nqp::istype($a,Baggy),
infix:<(&)>($a, $b.Bag),
nqp::if(
nqp::istype($a,Setty),
infix:<(&)>($a, $b.Set),
nqp::if(
nqp::isconcrete($b),
nqp::if(
nqp::istype($b,Mixy),
infix:<(&)>($a.Mix, $b),
nqp::if(
nqp::istype($b,Baggy),
infix:<(&)>($a.Bag, $b),
infix:<(&)>($a.Set, $b.Set)
)
),
infix:<(&)>($a, $b.Set)
)
)
)
),
infix:<(&)>($a.Set, $b)
)
}

0 comments on commit 9f5cc8d

Please sign in to comment.
You can’t perform that action at this time.