Skip to content

v1.7.1 — Out-of-range numbers are refused

Back to all updates
v1.7.1August 24, 2026

A fixed-width number outside its range is refused at the sender instead of wrapped.

Out-of-range numbers are refused before validators run

Section titled “Out-of-range numbers are refused before validators run”

A fixed-width number reserves an exact number of bits. A NumberU8 is one byte, which holds 0 to 255.

Twill.Net.Declare("SetStack", { Twill.Net.Types.NumberU8 })

Given 256, the codec used to write the value wrapped: 256 arrived as 0, -1 as 255, and a signed byte holding 200 as -56. The wrap happened before any Validate or Schema hook saw the value, so a handler that refuses anything above 100 was handed 0 and let it through.

before: 256 → written as 0 → validator sees 0 → accepted
after: 256 → refused at the sender, before the handler runs

Single values and every element of an array of fixed-width numbers are now refused when they are out of range.

A Union that named a fixed-width number compiled, then threw the first time it carried a number.

Twill.Net.Types.Union(Twill.Net.Types.NumberU8, Twill.Net.Types.NumberF64)

Every numeric kind is now reachable, matched widest first, so a union keeps the number it was given.

  • The last refusal messages with a Twill.Net: prefix, in the codec and the frame reader, now follow the shape introduced in v1.7.0.

Every change in this release is listed in the changelog.