-
-
Save jnthn/b1b1a569c930442a22f3ad2b17a29edc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/Perl6/Metamodel/BOOTSTRAP.nqp b/src/Perl6/Metamodel/BOOTSTRAP.nqp | |
index 8d89dba..2e76920 100644 | |
--- a/src/Perl6/Metamodel/BOOTSTRAP.nqp | |
+++ b/src/Perl6/Metamodel/BOOTSTRAP.nqp | |
@@ -1890,9 +1890,11 @@ BEGIN { | |
next; | |
} | |
- # If it's got a sub-signature, also need a bind check. | |
+ # If it's got a sub-signature, also need a bind check and | |
+ # to check constraint on every dispatch. | |
unless nqp::isnull(nqp::getattr($param, Parameter, '$!sub_signature')) { | |
%info<bind_check> := 1; | |
+ %info<constrainty> := 1; | |
} | |
# If it's named slurpy, we're done, also we don't need a bind | |
@@ -1917,6 +1919,7 @@ BEGIN { | |
# Record type info for this parameter. | |
if $flags +& $SIG_ELEM_NOMINAL_GENERIC { | |
%info<bind_check> := 1; | |
+ %info<constrainty> := 1; | |
%info<types>[$significant_param] := Any; | |
} | |
else { | |
@@ -1926,6 +1929,7 @@ BEGIN { | |
unless nqp::isnull(nqp::getattr($param, Parameter, '$!post_constraints')) { | |
%info<constraints>[$significant_param] := 1; | |
%info<bind_check> := 1; | |
+ %info<constrainty> := 1; | |
} | |
if $flags +& $SIG_ELEM_MULTI_INVOCANT { | |
$num_types++; | |
@@ -2235,7 +2239,7 @@ BEGIN { | |
# Since we had to do a bindability check, this is not | |
# a result we can cache on nominal type. | |
- $pure_type_result := 0; | |
+ $pure_type_result := 0 if nqp::existskey(%info, 'constrainty'); | |
# If we haven't got a possibles storage space, allocate it now. | |
$new_possibles := [] unless nqp::islist($new_possibles); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment