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

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

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



From: Aleks-Daniel Jakimenko-Aleksejev <alex.jakimenko [...] gmail.com>
Date: Sun, 13 Nov 2016 03:19:20 +0200
To: rakudobug [...] perl.org
Subject: Destructuring in “my” creates a null object (my ($x, [@y]) = 24, [40, 50])
Download (untitled) / with headers
text/plain 358b
Code:
my ($x, [@y]) = 24, [40, 50, 60]; say @y.perl

Result:
Cannot call method 'perl' on a null object
  in block <unit> at -e line 1


I am not sure what result would be right. Personally I was expecting @y to have three elements (40, 50, 60), but I don't know if it is supposed to work this way.

In any case, it should not return a null object, I think.
Whatever it means: https://irclog.perlgeek.de/perl6/2016-11-13#i_13560333

On 2016-11-12 17:19:35, alex.jakimenko@gmail.com wrote:
Show quoted text
> Code:
> my ($x, [@y]) = 24, [40, 50, 60]; say @y.perl
>
> Result:
> Cannot call method 'perl' on a null object
> in block <unit> at -e line 1
>
>
> I am not sure what result would be right. Personally I was expecting @y to
> have three elements (40, 50, 60), but I don't know if it is supposed to
> work this way.
>
> In any case, it should not return a null object, I think.




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