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

Multi-dim array subscript incorrectly returns a List when the indices are not of type Int #6453

Closed
p6rt opened this issue Aug 28, 2017 · 2 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Aug 28, 2017

Migrated from rt.perl.org#131981 (status was 'new')

Searchable as RT131981$

@p6rt
Copy link
Author

p6rt commented Aug 28, 2017

From @smls

These should both pass​:

  my @​a = ["a", ["b", "c"]];

  is-deeply @​a[1; 0], "b", 'multi-dim .[]';
  is-deeply @​a[1.0; "0"], "b", 'multi-dim .[] with non-Int indices';

But in current Rakudo, the second one fails because it returns the list
`("b",)` instead of the the string `"b"`.

This is caused by the line​:

https://github.com/rakudo/rakudo/blob/ab26b58/src/core/multidim_slice.pm#L62

I've sent a pull request which fixes this, among other things​:

  rakudo/rakudo#1139

@p6rt p6rt added the Bug label Jan 5, 2020
@lizmat
Copy link
Contributor

lizmat commented Jan 13, 2021

Closing as this appears to have been fixed with the 2017.12 release

@lizmat lizmat closed this as completed Jan 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants