New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weird error in anonymous class value in Hash #6067
Comments
From jns@gellyfish.co.ukHi, my @f = %{ class => class { has Int $.attr; }, }; say @f.perl Which gave rise to: When invoking 2 '', provided outer frame 0x2b11cb0 (4 '<unit>') does Which was definitely unexpected and not something I had seen before. Naming the class gives a different errror but suggests everything my @f = %{ class => class Foo { has Int $.attr; }, }; say @f.perl Giving: Odd number of elements found where hash initializer expected: Inlining the class does work like that does work without the additional my %f = class => class { has Int $.attr; }; say %f.perl Giving: {:class(<anon|60919760>)} Of course what I actually meant originally was: my @f = (%( "class" => class { has Int $.attr; }, ),); say @f.perl So I guess at the very least it's a LTA error message but does seem to |
From @zoffixznetGolfed a bit: <Zoffix> m: { foo => class {} }() |
The RT System itself - Status changed from 'new' to 'open' |
From @timoThis is caused by the way we differentiate between anonymous blocks and |
As a status update: The first example from the OP no longer gives a weird error:
So an Array with a Pair as the first (and only) element is created. That looks reasonable to me. |
Migrated from rt.perl.org#130763 (status was 'open')
Searchable as RT130763$
The text was updated successfully, but these errors were encountered: