Repository navigation
TSLANG_ISSUES 14: a literal union casts through its literals' type - #568
Merged
Merged
Conversation
`c ? 1 : 0` is the union `0 | 1`, stored untagged as s32. Cast straight to another type (an `index` variable, a parameter, a tuple field) it reached the lowering as a union, and `llvm.sext` of the union failed with no source location. castFromSourceSpecialCases now casts such a union to its literals' type first, as #560 did for binary operators. Found writing native_ts_graphics' graphics pipeline (TSLANG_ISSUES.md 14). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ASDAlexander77
added a commit
that referenced
this pull request
Oct 13, 2026
13, 14, 15 and 18 are fixed by #572, #568, #570 and #569. For 16, `%` is fixed by #571 and `/` stays a number. 17 is answered (`Deref(p[i]) = v` stores) and its error names that form since #573. 5 and 6 stay open: they are design questions, not bugs. 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.
TSLANG_ISSUES.md 14: a literal-union ternary stored as an integer tuple field failed in codegen.
c ? 1 : 0is the union0 | 1, stored untagged as s32. Cast straight to another type (anindexvariable, a parameter, a tuple field) it reached the lowering as a union, andllvm.sextof the union failed with<unknown>:0.castFromSourceSpecialCasesnow casts such a union to its literals' type first, as #560 did for binary operators.Test:
00literal_union_cast.ts(variable, parameter,number,s64, and the tuple-field repro from the issue).Full Release suite with all six TSLANG_ISSUES fixes together: 4074/4074.
🤖 Generated with Claude Code