You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a hash that accepts arbitrary objects as keys, an assignment using a list-like variable as a key works, but a binding interprets the list nature of the variable as a hash slice and fails:
17:02 < lizmat> m: my %h{Any}; my $key = slip("a",); %h{$key} = 1; dd %h # if this works
17:02 <+camelia> rakudo-moar 527f8d: OUTPUT«Hash[Any,Any] %h = (my Any %{Any} = (slip("a",)) => 1)»
17:02 < lizmat> m: my %h{Any}; my $key = slip("a",); %h{$key} := 1; dd %h # then this should work as well
17:02 <+camelia> rakudo-moar 527f8d: OUTPUT«Cannot bind to Hash[Any,Any] slice in block <unit> at <tmp> line 1»
As noted there, I'd be perfectly fine with a "make the assignment treat it as a slice too, then rethink your program and don't use lists as keys" resolution, but right now the behavior is inconsistent.
Thanks for developing Perl 6 so far that the problems that need to be reported are as hairy and obscure as this one! :)
Migrated from rt.perl.org#128619 (status was 'new')
Searchable as RT128619$
The text was updated successfully, but these errors were encountered: