-
-
Save Mouq/1420b193252f0cbaec31 to your computer and use it in GitHub Desktop.
Attempt at fixing RT #118555, https://rt.perl.org/Ticket/Display.html?id=118555
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 4b2a7f3..3f1fd5f 100644 | |
--- a/src/Perl6/Metamodel/BOOTSTRAP.nqp | |
+++ b/src/Perl6/Metamodel/BOOTSTRAP.nqp | |
@@ -563,16 +563,25 @@ my class Binder { | |
# Otherwise, go by sigil to pick the correct default type of value. | |
else { | |
+ my $nom_type := nqp::getattr($param, Parameter, '$!nominal_type'); | |
if $flags +& $SIG_ELEM_ARRAY_SIGIL { | |
- my $result := nqp::create(Array); | |
+ my $nom_subtype := $nom_type.of; | |
+ my $type := $nom_subtype =:= Mu | |
+ ?? Array | |
+ !! Array.HOW.parameterize(Array, $nom_subtype); | |
+ my $result := nqp::create($type); | |
nqp::bindattr($result, List, '$!flattens', nqp::p6bool(1)); | |
$result | |
} | |
elsif $flags +& $SIG_ELEM_HASH_SIGIL { | |
- nqp::create(Hash) | |
+ my $nom_subtype := $nom_type.of; | |
+ my $type := $nom_subtype =:= Mu | |
+ ?? Hash | |
+ !! Hash.HOW.parameterize(Hash, $nom_subtype); | |
+ nqp::create($type) | |
} | |
else { | |
- nqp::getattr($param, Parameter, '$!nominal_type'); | |
+ $nom_type | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment