On Wed Mar 11 20:54:04 2015, Mouq wrote: > Not sure if this worked before, but these examples work fine if one > uses binding instead of assignment. > > On Fri May 17 03:45:49 2013, elizabeth wrote: > > [12:36:12] <lizmat> r: my %h{Any}; my %i=%h.new; say %h.WHAT; > > say > > %i.WHAT # did we agree that this was a rakudobug? > > [12:36:14] <+camelia> rakudo 570d1d: > > OUTPUT«(Hash+{TypedHash})(Hash)» > > 03:52 <Mouq> m: my %h{Any}; my %i:=%h.new; say %h.WHAT; say %i.WHAT > 03:52 <camelia> rakudo-moar e84f71: > OUTPUT«(Hash[Any,Any])(Hash[Any,Any])» > > > [12:44:27] <lizmat> r: my %h{Any}; my %i=%h.clone; say %h.WHAT; > > say %i.WHAT # it also goes wrong for .clone, I assume because it > > uses > > .new > > [12:44:28] <+camelia> rakudo 570d1d: > > OUTPUT«(Hash+{TypedHash})(Hash)» > > 03:52 <Mouq> m: my %h{Any}; my %i:=%h.clone; say %h.WHAT; say %i.WHAT > 03:52 <camelia> rakudo-moar e84f71: > OUTPUT«(Hash[Any,Any])(Hash[Any,Any])» > > Since %i is a normal Hash by default, can this be closed with tests?
Yes, the binding/assignment distinction here is important, and Rakudo's behavior is by design. Added tests to S09-typed-arrays/hashes.t to codify this.