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

At-pos/at-key/zen slices hypered over empty List/Array crash #2133

Open
zoffixznet opened this Issue Jul 25, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@zoffixznet
Contributor

zoffixznet commented Jul 25, 2018

These work:

m: dd (<a b>,)»[]
rakudo-moar a71e370bb: OUTPUT: «(("a", "b"),)␤»
m: dd ({:42foo},)»{}
rakudo-moar a71e370bb: OUTPUT: «({:foo(42)},)␤»
m: my @a = 42; dd @a»[]
 rakudo-moar a71e370bb: OUTPUT: «(42,)␤»
m: my @a = {:42foo},; dd @a»{} 
rakudo-moar a71e370bb: OUTPUT: «({:foo(42)},)␤»

But if the List/Array is empty, they crash:

rakudo-moar a71e370bb: OUTPUT: «This type (Scalar) does not support elems␤  in block <unit> at <tmp> line 1␤␤»
m: my @a; @a»[]                                                                
rakudo-moar a71e370bb: OUTPUT: «This type (Mu) does not support elems␤  in block <unit> at <tmp> line 1␤␤»
m: dd ()»{}                                                                                                                                          │
rakudo-moar a71e370bb: OUTPUT: «This type (Scalar) does not support elems␤  in block <unit> at <tmp> line 1␤␤»
m: my @a; @a»{}
rakudo-moar a71e370bb: OUTPUT: «This type (Mu) does not support elems␤  in block <unit> at <tmp> line

Happens with regular at-key/at-pos instead of zen slices as well:

m: my @a; @a».[1]
rakudo-moar a71e370bb: OUTPUT: «This type (Mu) does not support elems␤  in block <unit> at <tmp> line 1␤␤»
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment