On Mon, May 13, 2013 at 11:54:38AM -0700, Carl Mäsak wrote: > <lizmat> r: my %a= (a => 1, b => 2); say %a<c>:p # shouldn't this be Nil ? > <camelia> rakudo 2a04f2: OUTPUT«"c" => Any» > <masak> lizmat: yeah, think so. > * masak submits rakudobug
I'm pretty sure rakudo is correct in this case. We know that %a<c> should return a value with a vivifying WHENCE property (for assignment), so the only question is what value it should return. In particular, "my %h;" is like saying "my Any %h", in that the hash is a set of Scalar containers that default to "Any". If the declaration were "my Int %h", then I'd expect %h<c> to return "Int". > <masak> r: my %a= (a => 1, b => 2); say %a<a b c>:p > <camelia> rakudo 2a04f2: OUTPUT«"a" => 1 "b" => 2 » This is a legitimate bug, IMO. I think there should be a "c" => Any pair returned here, where the Any has a WHENCE clause to autovivify the hash entry. Again, consider %a<a b c> = 4..6; Pm