On 2/25/24 17:45, Joseph Brenner wrote:
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
bu
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)
On 2/10/24 02:41, Elizabeth Mattijsen wrote:
On 10 Feb 2024, at 08:56, ToddAndMargo via perl6-users
wrote:
Hi All,
Is there a switch to tell Raku to bomb out with a
type mismatch rather than coercing the following?
my uint16 $x = -1
65535
No, this is intentional behaviour on native integ
> On 10 Feb 2024, at 08:56, ToddAndMargo via perl6-users
> wrote:
>
> Hi All,
>
> Is there a switch to tell Raku to bomb out with a
> type mismatch rather than coercing the following?
>
> > my uint16 $x = -1
> 65535
No, this is intentional behaviour on native integers.
Note that you can incr
Hi All,
Is there a switch to tell Raku to bomb out with a
type mismatch rather than coercing the following?
> my uint16 $x = -1
65535
Many thanks,
-T
--
If I had a dime every time I didn't know
what was going on, I'd be like, "Why is
everyone giving m