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

Destructuring in “my” creates a null object (my ($x, [@y]) = 24, [40, 50]) #5795

Open
p6rt opened this issue Nov 13, 2016 · 2 comments
Open

Comments

@p6rt
Copy link

p6rt commented Nov 13, 2016

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

Searchable as RT130079$

@p6rt
Copy link
Author

p6rt commented Nov 13, 2016

From @AlexDaniel

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.

@p6rt
Copy link
Author

p6rt commented Nov 13, 2016

From @AlexDaniel

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​:

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant