Skip to content

Commit

Permalink
Try matching parameters by their addresses
Browse files Browse the repository at this point in the history
Thus we can match a definite to itself and have R[T:D] ~~ R[T:D] in
cases where lhs comes from a class as a consumed role and has different
object id from rhs. For example, this solves `Array[Str:D] ~~
`Positional[Str:D]`.
  • Loading branch information
vrurg committed Dec 28, 2019
1 parent 9a571b6 commit fb55ae2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Perl6/Metamodel/CurriedRoleHOW.nqp
Expand Up @@ -224,7 +224,9 @@ class Perl6::Metamodel::CurriedRoleHOW
my int $i := -1;
my int $ok := 1;
while ($i := $i + 1) < $num_args {
unless @!pos_args[$i].ACCEPTS(@try_args[$i]) {
unless nqp::eqaddr(nqp::decont(@!pos_args[$i]), nqp::decont(@try_args[$i]))
|| @!pos_args[$i].ACCEPTS(@try_args[$i])
{
$ok := 0;
$i := $num_args;
}
Expand Down

0 comments on commit fb55ae2

Please sign in to comment.