Skip to content

Commit

Permalink
Make sure method is returned
Browse files Browse the repository at this point in the history
Alternate implementation of PR #3403, without using return.
Bartolin++ for spotting and making the PR
  • Loading branch information
lizmat committed Jan 3, 2020
1 parent f602c02 commit abcf37f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/Perl6/Metamodel/ConcreteRoleHOW.nqp
Expand Up @@ -146,14 +146,18 @@ class Perl6::Metamodel::ConcreteRoleHOW
$found-role := $candidate;
}
}
return nqp::null() if nqp::isnull($found-role);
return $found-role.HOW.method_table($found-role){$name}
|| $found-role.HOW.submethod_table($found-role){$name}
|| nqp::null();
} elsif nqp::istype($obj, $qtype) {
nqp::isnull($found-role)
?? nqp::null()
!! $found-role.HOW.method_table($found-role){$name}
|| $found-role.HOW.submethod_table($found-role){$name}
|| nqp::null()
}
elsif nqp::istype($obj, $qtype) {
# Non-parametric, so just locate it from the already concrete type.
nqp::findmethod($qtype, $name)
}
nqp::null()
else {
nqp::null()
}
}
}

0 comments on commit abcf37f

Please sign in to comment.