On 2019-12-11 10:22, Fernando Santagata wrote:
File test.pm6

unit module test;
subset PosInt of Int is export where * > 0;


File test.p6

use lib '.';
use test;
sub mytest(PosInt $a) { say $a }
mytest(1);     # output: 1
mytest(-1);    # output Constraint type check failed in binding to parameter '$a'; expected test::PosInt but got Int (-1)

Hi Fernando,

What response do you get back with?

    perl6 -c test.pl6

-T

Reply via email to