Skip Menu |
Report information
Id: 131981
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: smls75 [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



From: Sam S <smls75 [...] gmail.com>
Subject: [BUG] Multi-dim array subscript incorrectly returns a List when the indices are not of type Int
To: Rakudo Bugtracker <rakudobug [...] perl.org>
Date: Mon, 28 Aug 2017 21:06:37 +0200
Download (untitled) / with headers
text/plain 519b
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: https://github.com/rakudo/rakudo/pull/1139


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org