Skip to content

fix(runtime): longCast unboxes a boxed ulong as ulong, not long - #33

Merged
skydread1 merged 1 commit into
maint-1.11.xfrom
fix/boxed-ulong-cast
Sep 1, 2026
Merged

fix(runtime): longCast unboxes a boxed ulong as ulong, not long#33
skydread1 merged 1 commit into
maint-1.11.xfrom
fix/boxed-ulong-cast

Conversation

@skydread1

Copy link
Copy Markdown
Member

Closes #31

  • RT.longCast(object) returns the ulong local its type check produced instead of unboxing the UInt64 box as Int64, which the CLR rejects, so (long x) and (int x) on a boxed UInt64 convert instead of throwing InvalidCastException.

longCast(object) now returns the ulong local its type check already
produced instead of unboxing the box a second time as Int64, which the
CLR rejects for a UInt64 box. Casting any boxed ulong threw
InvalidCastException, and intCast(object) delegates here, so (int ...)
failed the same way.
@skydread1 skydread1 self-assigned this Sep 1, 2026
@skydread1
skydread1 merged commit 6608de1 into maint-1.11.x Sep 1, 2026
3 checks passed
@skydread1
skydread1 deleted the fix/boxed-ulong-cast branch September 1, 2026 05:54
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.

Casting a boxed UInt64 throws InvalidCastException

1 participant