Use typed integer literals so Std builds under strict overload resolution#45
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #43.
After rux-lang/Rux#136 (
LookupFunction no longer silently falls back to first overload), the overload resolver enforces argument assignability, so untypedintliterals passed touint/uint32/int32parameters 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.rux—Exit(1)/Exit(2)->Exit(1u32)/Exit(2u32)(Exit(code: uint32)).Src/Memory.rux—Set(ptr, size, 0)->0i32(Set(..., value: int32)) in everyZerobranch; heap-flags0->0u32inHeapAlloc/HeapReAlloc/HeapFree.Src/Char8.rux,Src/Char16.rux,Src/Char32.rux—String::From(buf.data, N)->Nu(From(str, length: uint)).Src/String.rux—Alloc(0)->Alloc(0u).Src/Print.rux— the dwFlags0toMultiByteToWideChar->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.