Skip to content

unsigned conversion regression #12554

@mratsim

Description

@mratsim

The following used to give 44 on 0.20.2.

It now raises an error range error on 1.0.

let x = 300'u
echo byte(x)

This broke our upcoming networking code: vacp2p/nim-libp2p@541f0f2. In general, I don't think people expect range checking on unsigned integers, especially on converting to raw byte.

This may have a large impact on low-level code for example: graphics, crypto, networking, emulation ...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions