Re: disable coercing?
[email protected] (Joseph Brenner)
| Newsgroups | perl.perl6.users |
|---|---|
| Message-ID | <CAFfgvXX_OO-=Ld9t9su7z=2yagp=kCU9Ojfr+wiVFG=cpjUATQ@mail.gmail.com> |
Would this trick help? You can define a "subset" that restricts
values to the uint16 range:
my subset FussyUint16 of Int where 0 ..^ 2¹⁶;
my FussyUint16 $x;
$x = -1;
## Type check failed in assignment to $x; expected FussyUint16
but got Int (-1)