Repository navigation
TSLANG_ISSUES 13: generic inference through Ref<T> and union members by type - #572
Merged
Merged
Conversation
A generic function's T was not inferred from an argument of a generic tuple alias holding references (`Vec<T> = [first: Ref<T> | null, ...]`): inference had no case for Ref<T>, not even for a plain `Ref<T>` parameter. Also, two unions were matched member by member in order, so `T | null` against `Item | null` could bind T to null; members both unions have now bind nothing, and the rest are paired. Found writing stdVectorSize<T> for native_ts_graphics' NVRHI bindings (TSLANG_ISSUES.md 13). 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 13: a generic function's
Twasn't inferred from an argument of a generic tuple alias (Vec<T> = [first: Ref<T> | null, last: Ref<T> | null]).Ref<T>, so even a plainf<T>(r: Ref<T>)failed. AddedtryInferRef.T | nullagainstItem | nullcould bindT = null. Members both unions share now bind nothing and the rest are paired; the old positional pairing is kept when the leftover counts differ.Test:
00generic_ref_inference.ts(the issue'scount(v), a plainRef<T>parameter,[value: T | null]).Full Release suite with all six TSLANG_ISSUES fixes together: 4074/4074.
🤖 Generated with Claude Code