Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
A refinement type should carry the methods of its refinee.
  • Loading branch information
jnthn committed Jun 14, 2011
1 parent c6d592d commit 53ad49c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Perl6/Metamodel/SubsetHOW.pm
Expand Up @@ -26,6 +26,13 @@ class Perl6::Metamodel::SubsetHOW
$!refinement
}

# Should have the same methods of the (eventually nominal) type
# that we refine. (For the performance win, work out a way to
# steal its method cache.)
method find_method($obj, $name) {
pir::find_method__PPS($!refinee, $name)
}

# Do check when we're on LHS of smartmatch (e.g. Even ~~ Int).
method type_check($obj, $checkee) {
pir::perl6_booleanize__PI(pir::istrue($checkee.HOW =:= self) ||
Expand Down

0 comments on commit 53ad49c

Please sign in to comment.