Skip to content

Use typed integer literals so Std builds under strict overload resolution#45

Merged
spatulari merged 1 commit into
rux-lang:devfrom
FeliceMente:fix/strict-overload-literals
Jun 14, 2026
Merged

Use typed integer literals so Std builds under strict overload resolution#45
spatulari merged 1 commit into
rux-lang:devfrom
FeliceMente:fix/strict-overload-literals

Conversation

@FeliceMente

Copy link
Copy Markdown

Fixes #43.

After rux-lang/Rux#136 (LookupFunction no longer silently falls back to first overload), the overload resolver enforces argument assignability, so untyped int literals passed to uint/uint32/int32 parameters no longer resolve and Std fails to compile. The old resolver silently returned the lone/first overload without checking arguments, which masked these latent mismatches.

This adds the matching type suffix at each such call site (in line with the repo convention that typed integer literals are explicit):

  • Src/Fatal.rux, Src/Assert.ruxExit(1)/Exit(2) -> Exit(1u32)/Exit(2u32) (Exit(code: uint32)).
  • Src/Memory.ruxSet(ptr, size, 0) -> 0i32 (Set(..., value: int32)) in every Zero branch; heap-flags 0 -> 0u32 in HeapAlloc/HeapReAlloc/HeapFree.
  • Src/Char8.rux, Src/Char16.rux, Src/Char32.ruxString::From(buf.data, N) -> Nu (From(str, length: uint)).
  • Src/String.ruxAlloc(0) -> Alloc(0u).
  • Src/Print.rux — the dwFlags 0 to MultiByteToWideChar -> 0u32.

No logic or signature changes. Verified Std compiles against Rux dev HEAD (2935404) on macOS (x86-64 Mach-O output); the non-macOS @[Target] branch edits are signature-verified and mirror the macOS pattern.

Note: this is platform-neutral, so it affects every target's Std build, not just macOS.

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.

2 participants