Skip Menu |
Report information
Id: 130293
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: moritz <moritz.lenz [at]>

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)

To: rakudobug [...]
Date: Wed, 7 Dec 2016 22:00:04 +0100
From: Moritz Lenz <moritz [...]>
Subject: is default on a hash prevents autovivification, but doesn't work on its own either
Download (untitled) / with headers
text/plain 649b
moritz: m: my %h is default([]); %h<a>.push: 1; %h<b>.push: 2; say %h camelia: rakudo-moar 2d0198: OUTPUT«{}␤» moritz: m: my %h; %h<a>.push: 1; %h<b>.push: 2; say %h camelia: rakudo-moar 2d0198: OUTPUT«{a => [1], b => [2]}␤» moritz: does this look like a bug to anybody else? babydrop: yeah moritz: I was curious whether it created two distinct arrays, but didn't expect to see %h empty * moritz rakudos submitbug I expected the output from the first to be {a => [1, 2], b => [1, 2]}, or if 'is default' clones the value, {a => [1], b => [2]}. -- Moritz Lenz -- --

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at