Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Something with "is rw" is narrower than without.
Provided types match. However, since we do not yet actually enforce
being passed a mutable thing with "is rw" in signatures, this alone
is not enough for actually differentiating the two.
  • Loading branch information
jnthn committed Sep 24, 2015
1 parent d7ff0bb commit 855512f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Perl6/Metamodel/BOOTSTRAP.nqp
Expand Up @@ -1742,10 +1742,14 @@ BEGIN {
my $type_obj_b := %b<types>[$i];
if nqp::eqaddr($type_obj_a, $type_obj_b) {
# Same type; narrower if first has constraints and other doesn't;
# tied if neither has constraints or both have constraints. */
# narrower if first is rw and second isn't; tied if neither has
# constraints or both have constraints.
if %a<constraints>[$i] && !%b<constraints>[$i] {
$narrower++;
}
elsif nqp::atpos_i(%a<rwness>, $i) > nqp::atpos_i(%b<rwness>, $i) {
$narrower++;
}
elsif (!%a<constraints>[$i] && !%b<constraints>[$i])
|| (%a<constraints>[$i] && %b<constraints>[$i]) {
$tied++;
Expand Down

0 comments on commit 855512f

Please sign in to comment.