Re: disable coercing?

[email protected] (Elizabeth Mattijsen)
Newsgroups perl.perl6.users
Message-ID <[email protected]>
> On 10 Feb 2024, at 08:56, ToddAndMargo via perl6-users <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.