Skip to content
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

Interpolating a typed hash into an argument list produces wrong keys #4886

Closed
p6rt opened this issue Dec 17, 2015 · 7 comments
Closed

Interpolating a typed hash into an argument list produces wrong keys #4886

p6rt opened this issue Dec 17, 2015 · 7 comments

Comments

@p6rt
Copy link

p6rt commented Dec 17, 2015

Migrated from rt.perl.org#126951 (status was 'resolved')

Searchable as RT126951$

@p6rt
Copy link
Author

p6rt commented Dec 17, 2015

From @smls

Example​:

  sub f (*%args) {
  say .perl for %args.keys
  }
 
  my %typedhash := :{ a => 1, b => 2 };
 
  f |%typedhash;

Ouput​:

  "Str|a"
  "Str|b"

Expected output​:

  "a"
  "b"

@p6rt
Copy link
Author

p6rt commented Aug 25, 2016

@coke - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Aug 26, 2017

From @smls

This bug is still present in

Rakudo version 2017.08-8-g753c9a5ea built on MoarVM version 2017.08.1-19-g151a2563
implementing Perl 6.c.

@p6rt
Copy link
Author

p6rt commented Aug 26, 2017

From @smls

Shorter test-case​:

  ➜ say :{ a => 1, b => 2 }.FLATTENABLE_HASH;
  {Str|a => a => 1, Str|b => b => 2}

Compare to a normal Hash which works fine​:

  ➜ say { a => 1, b => 2 }.FLATTENABLE_HASH;
  {a => 1, b => 2}

@p6rt
Copy link
Author

p6rt commented Aug 26, 2017

From @lizmat

Fixed with 6cec6b7218650aff1780a4dd , tests needed

On 26 Aug 2017, at 10​:35, Sam S. via RT <perl6-bugs-followup@​perl.org> wrote​:

Shorter test-case​:

➜ say :{ a => 1, b => 2 }.FLATTENABLE_HASH;
{Str|a => a => 1, Str|b => b => 2}

Compare to a normal Hash which works fine​:

➜ say { a => 1, b => 2 }.FLATTENABLE_HASH;
{a => 1, b => 2}

@p6rt
Copy link
Author

p6rt commented Oct 6, 2017

From @smls

Test added​: Raku/roast@8773139c37

Closing.

@p6rt
Copy link
Author

p6rt commented Oct 6, 2017

@smls - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Oct 6, 2017
@p6rt p6rt added the testneeded label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant