diff --git a/src/Perl6/Actions.pm b/src/Perl6/Actions.pm index 3d61b2536e3..cdfe9b0408d 100644 --- a/src/Perl6/Actions.pm +++ b/src/Perl6/Actions.pm @@ -692,7 +692,9 @@ sub declare_variable($/, $past, $sigil, $twigil, $desigilname, $trait_list) { # Not an attribute - need to emit delcaration here. # First, create a container and give it a 'rw' property # Create the container, give it a 'rw' property - my $cont := PAST::Op.new( sigiltype($sigil), :pirop('new Ps') ); + my $cont := $sigil eq '%' ?? + PAST::Op.new( :name('&CREATE_HASH_LOW_LEVEL'), :pasttype('call') ) !! + PAST::Op.new( sigiltype($sigil), :pirop('new Ps') ); my $true := PAST::Var.new( :name('true'), :scope('register') ); my $vivipast := PAST::Op.new( $cont, 'rw', $true, :pirop('setprop')); diff --git a/src/core/EnumMap.pm b/src/core/EnumMap.pm index 6a3e0765b24..019097658df 100644 --- a/src/core/EnumMap.pm +++ b/src/core/EnumMap.pm @@ -19,4 +19,6 @@ role EnumMap { done: } } + + } diff --git a/src/core/Hash.pm b/src/core/Hash.pm index 8870bdc177b..d3bd8fd7408 100644 --- a/src/core/Hash.pm +++ b/src/core/Hash.pm @@ -1,5 +1,6 @@ role Hash is EnumMap { method postcircumfix:<{ }>($key) { + $key ~= $key; Q:PIR { .local pmc self self = find_lex 'self' diff --git a/src/glue/types.pir b/src/glue/types.pir index d3ab411d982..ee27945c793 100644 --- a/src/glue/types.pir +++ b/src/glue/types.pir @@ -57,7 +57,10 @@ subtyping relations, etc). .sub '&CREATE_HASH_LOW_LEVEL' - .param pmc storage + .param pmc storage :optional + unless null storage goto have_storage + storage = root_new ['parrot';'Hash'] + have_storage: $P0 = get_hll_global 'Hash' $P0 = $P0.'!select'() $P0 = $P0.'!pun'()