Open
Description
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»
Activity
dogbert17 commentedon Oct 22, 2020
Fixed with commit 9b50329 lizmat++