Several things happen here: first of all, if you use (1,2,3) as a key, Rakudo Perl 6 will consider this as a slice of 3 keys: 1 , 2 and 3 . Since none of them exist in the hash of the object, you get ((Any) (Any) (Any)) .
So, you need to specify that you want the list to be considered as the only key for which you want to get the value. You can do this with $() , so %sum{$(1,3,5)} . This, however, does not give you the intended result. The reason for this is as follows:
> say (1,2,3).WHICH eq (1,2,3).WHICH False
Hashes of objects internally point an object to its .WHICH value. List not currently considered a value type, so each List has a different .WHICH . This makes them unsuitable for use as keys in hashes of objects or in other cases when they are used by default (for example, .unique and Set s, Bag and Mix es).
I'm actually working on making it higher than eq return True soon: this should be done in the compiler release 2018.01, which will also release the Rakudo Star release.
BTW, anytime you use object hashes and integer values, you probably would be better off using Bag s. Alas, in this case, not yet for this reason.
You could do this work by using the augment class List and adding the .WHICH method to it, but I would recommend against this, as this will interfere with any future fixes.