Skip to content

Commit

Permalink
Need to attach the originally refined type to the subtype so the sign…
Browse files Browse the repository at this point in the history
…ature binder can get the nominal and constrainty parts of it. The corrects a less than awesome error and probably much more.
  • Loading branch information
jnthn committed Jul 19, 2010
1 parent 0b12127 commit 1231260
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/glue/subset.pm
Expand Up @@ -10,7 +10,7 @@ role SubType {
}
}

our sub CREATE_SUBSET_TYPE(Mu $original, $checker) {
our sub CREATE_SUBSET_TYPE(Mu \$original, $checker) {
# XXX Ideally we'd be able to just replace all of what follows
# with a simple:
# my $subtype = $original but SubType($checker);
Expand All @@ -29,7 +29,14 @@ our sub CREATE_SUBSET_TYPE(Mu $original, $checker) {
setprop $P3, 'metaclass', $P4
%r = new $P3
transform_to_p6opaque %r
$P0 = find_lex '$checker'
setattribute %r, '$!checker', $P0
$P5 = find_lex '$checker'
setattribute %r, '$!checker', $P5
$P6 = getprop 'subtype_realtype', $P0
if null $P6 goto original_unrefined
setprop %r, 'subtype_realtype', $P6
goto refinement_done
original_unrefined:
setprop %r, 'subtype_realtype', $P0
refinement_done:
};
}

0 comments on commit 1231260

Please sign in to comment.