Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: disable coercing?

1 view
Skip to first unread message

Elizabeth Mattijsen

unread,
Feb 10, 2024, 6:00:04 AM2/10/24
to ToddAndMargo via perl6-users
> On 10 Feb 2024, at 08:56, ToddAndMargo via perl6-users <perl6...@perl.org> 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 increment such a value without problems:

[0] > my uint16 $x = -1;
65535
[1] > ++$x
0
0 new messages