Repository navigation
00any_to_opaque_narrow: a u64 keeps as many bytes as a pointer holds - #841
Merged
Merged
Conversation
The test expected `<Opaque><any><u64>0x123456789A` to keep all 8 bytes, which only a 64-bit pointer has room for: its x86 twin failed with "a u64 is all 8 bytes". On i686 the compiler keeps the low 4 bytes (0x3456789A) under every model, as it should, so the expectation now follows sizeof<Opaque>(). All 12 variants pass: JIT, x64 and x86, under gc/rc/none/own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
This fixes a wrong expectation in
00any_to_opaque_narrow.ts. The test expected<Opaque><any><u64>0x123456789Ato keep all 8 bytes, but only a 64-bit pointer has room for that. Its x86 twin (TSLANG_TEST_X86) failed with "a u64 is all 8 bytes".On i686 the compiler keeps the low 4 bytes (
0x3456789A) under rc, own and none, which is the correct result for a 4-byte pointer. The expected value now followssizeof<Opaque>(): 8 bytes on x64, the low 4 on x86. This changes only the test, not the compiler.Tests
ctest -R any-to-opaque-narrow: all 12 variants pass (JIT and exe on x64, exe on x86, under gc, rc, none and own).🤖 Generated with Claude Code