I'm not sure why this is necessary, most perl6 programmers declare a subset for an array element, but not for the array itself. Rakudo decides to create a List instead of Array the same trap appears when using the Rat type instead of Num . In any case, it is possible. The subset is not fully qualified (it is not possible). You must explicitly create the array $aoi = Array[Int].new(1,2,3,4,5,6) .
> subset AoI of Array of Int > my AoI $aoi; > $aoi = Array[Int].new > $aoi.append(1,2,3,4) [1 2 3 4] > $aoi.append("mystr") Type check failed in assignment to ; expected Int but got Str in block <unit> at <unknown file> line 1
source share