Hi,
It's because of the default value of array elements. See the end of this
section: https://docs.perl6.org/language/list#Typing
my @a;
say @a.of.perl; # Mu
say @a.default.perl; # Any
say @a[0]; # (Any)
role Foo {};
my Foo @a;
say @a.of.perl; # Foo
say @a.default.perl; # Foo
say @a[0] # (Foo)
Hi There,
I am not sure if my RoleType @array; is correct, or if there is a better
way to declare such an array. But I find the error that is happening
when there are no elements in the array confusing on the first sight. It
took me a while to realize that my array was empty and therefore it