/patch.diff Secret
Created
August 6, 2016 21:22
Star
You must be signed in to star a gist
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
| commit b8a140d54ca4b4524fb08244ab3444e26edcb099 | |
| Author: Timo Paulssen <timonator@perpetuum-immobile.de> | |
| Date: Tue Mar 3 20:51:42 2015 +0100 | |
| make @ and % sigiled vars have :D by default | |
| sadly messes up one test where the optimizer should have | |
| complained about an impossible call (S06-signature/errors.t) | |
| diff --git a/src/Perl6/Actions.nqp b/src/Perl6/Actions.nqp | |
| index 3ab2eed..865589a 100644 | |
| --- a/src/Perl6/Actions.nqp | |
| +++ b/src/Perl6/Actions.nqp | |
| @@ -3668,14 +3668,17 @@ class Perl6::Actions is HLL::Actions does STDActions { | |
| # Depending on sigil, use appropriate role. | |
| my int $need_role; | |
| + my int $need_defined; | |
| my $role_type; | |
| if $sigil eq '@' { | |
| $role_type := $*W.find_symbol(['Positional']); | |
| $need_role := 1; | |
| + $need_defined := 1; | |
| } | |
| elsif $sigil eq '%' { | |
| $role_type := $*W.find_symbol(['Associative']); | |
| $need_role := 1; | |
| + $need_defined := 1; | |
| } | |
| elsif $sigil eq '&' { | |
| $role_type := $*W.find_symbol(['Callable']); | |
| @@ -3689,6 +3692,7 @@ class Perl6::Actions is HLL::Actions does STDActions { | |
| else { | |
| %*PARAM_INFO<nominal_type> := $role_type; | |
| } | |
| + %*PARAM_INFO<defined_only> := 1 if $need_defined; | |
| } | |
| # Handle twigil. | |
| diff --git a/src/core/Parameter.pm b/src/core/Parameter.pm | |
| index 9ea3fc9..88f3a92 100644 | |
| --- a/src/core/Parameter.pm | |
| +++ b/src/core/Parameter.pm | |
| @@ -168,7 +168,8 @@ my class Parameter { # declared in BOOTSTRAP | |
| else { | |
| $perl = $type; | |
| } | |
| - if $!flags +& $SIG_ELEM_DEFINED_ONLY { | |
| + if $!flags +& $SIG_ELEM_DEFINED_ONLY && | |
| + !($!flags +& ($SIG_ELEM_ARRAY_SIGIL +| $SIG_ELEM_HASH_SIGIL)) { | |
| $perl ~= ':D'; | |
| } elsif $!flags +& $SIG_ELEM_UNDEFINED_ONLY { | |
| $perl ~= ':U'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment