You got the order of operations wrong. Method calls happen before prefix operators
These are identical +@a.so +(@a.so) @a.so.Numeric @a.Bool.Numeric +?@a As are these +«@a».so +«(@a».so) @a».so».Numeric @a».Bool».Numeric +«?«@a Postfix operators also happen before prefix operators generally (depends on precedence) ?$a++ ?($a++) --- This leads me to question why you used the `+` prefix operator at all? It could only ever be slower (or more wrong) than just using `.so` `.Bool` or prefix `?` `.so` only has to check to see if the array is longer than zero elements. By converting it to Numeric it would have to count all of the values first. (I don't think it actually works like this) If it is declared with a lazy list it will throw an error. my @a = 1,1, *+* ... *; +@a; # Failure: Cannot .elems a lazy list ?@a; # True ?+@a; # False That is False because a Failure is always False. On Fri, Dec 21, 2018 at 2:28 AM Richard Hainsworth <rnhainswo...@gmail.com> wrote: > > A snippet: > > my @a = 1..10; > put +@a.so; # output 1 > put so(+@a); # output True > put (+@a).so; # output True > > This caught me because I used +@s.so when I tried to do something like: > > # in a class with 'has Bool $.pass;' > return unless ( $!pass = +@a.so ); > # fails with a Type mismatch of Int being assigned to Bool > > Is this an expected result, or a bug? > > > (I was going to ask this on StackOverflow, but it seems so like a bug > that I decided to ask here first)