Come definire un tipo personalizzato di un riferimento di array di Ints in Perl 6? Ho provato questo, ma non funziona:Come definire un tipo personalizzato di Arrayreference di Ints in Perl 6?
subset Array_of_Int of Array where *.all ~~ Int;
my $n = My::Class.new(option => < 22 3 4 5 >);
# Type check failed in assignment to $!option; expected My::Class::Array_of_Int but got List in block <unit> at ...
Ho bisogno solo 'ha Int @ .option', ma non sapevo che prima. –