Skip to content

Commit

Permalink
Fix role typechecking over its parent class
Browse files Browse the repository at this point in the history
Further fixes #2714. Unfortunate misordering of arguments in a call to
`nqp::istype` resulted in roles always matching their direct parent only
but failing with parents of parents, or with roles consumed by any
parent.
  • Loading branch information
vrurg committed May 31, 2023
1 parent a1acdb6 commit a4201c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Perl6/Metamodel/ParametricRoleHOW.nqp
Expand Up @@ -114,7 +114,7 @@ class Perl6::Metamodel::ParametricRoleHOW
# $checkee must always be decont'ed
method type_check_parents($obj, $checkee) {
for self.parents($obj, :local) -> $parent {
if nqp::istype($checkee, $parent) {
if nqp::istype($parent, $checkee) {
return 1;
}
}
Expand Down

0 comments on commit a4201c2

Please sign in to comment.