Skip to content

[Upstream] fix(wit): keep the size and sign of WIT integers - #47

Closed
moetemp wants to merge 1 commit into
moe/up/mainfrom
moe/up/wit-64-bit-ints
Closed

moetemp wants to merge 1 commit into
moe/up/mainfrom
moe/up/wit-64-bit-ints

Conversation

@moetemp

@moetemp moetemp commented Oct 22, 2026

Copy link
Copy Markdown
Owner

What changed?

This PR plans WIT s64 and u64 as 64-bit integers on the WIT path.

The parser mapped every WIT integer type to the 32-bit integer type, s64 and u64 too. Only a field with a proto descriptor behind it got the 64-bit type. Now s64 and u64 map to the 64-bit type, and s8 to s32 and u8 to u32 stay as they were.

The change shows in the types that only WIT describes: fields of records without @nexus.proto, and resource method parameters.

  • .NET: long in place of int.
  • Go: int64 in place of int32.
  • TypeScript: Long in place of number, the same type as a proto int64 field. This changes the JSON shape of these fields in TypeScript models. Please check that this is the wanted type.
  • Python: no change, since int has no size.

nexgen has no unsigned integer type, so u64 maps to the signed 64-bit type, as a proto uint64 field does.

Why?

A 64-bit value, such as an offset or a count, was cut to 32 bits in .NET and Go when the record was WIT-only. A value above 2^31 overflowed with no error.

How did you test it?

tests/generate_dotnet.rs generates a WIT-only record with s64, u64 and s32 fields, and checks long, long and int. The test fails on main.

cargo test --features advanced passes. cargo build-examples for Python, TypeScript, .NET and Go gives no diff, since no sample has a WIT-only 64-bit field. cargo validate go passes, and the .NET sample tests and builds pass in a mcr.microsoft.com/dotnet/sdk:9.0 container.

Came from fork PR #46.

@moetemp

moetemp commented Oct 22, 2026

Copy link
Copy Markdown
Owner Author

Opened upstream as temporalio#265. The branch stays, since that PR uses it.

@moetemp moetemp closed this Oct 22, 2026
@moetemp moetemp changed the title [Upstream] Planned WIT s64 and u64 as 64-bit integers. [Upstream] fix: map WIT s64 and u64 to 64-bit integers Oct 22, 2026
@moetemp moetemp changed the title [Upstream] fix: map WIT s64 and u64 to 64-bit integers fix(wit): keep the size and sign of WIT integers Oct 22, 2026
@moetemp moetemp changed the title fix(wit): keep the size and sign of WIT integers [Upstream] fix(wit): keep the size and sign of WIT integers Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant