feat: fall back to type checker for non-generic type aliases with unresolvable utility types#2513
Open
puckey wants to merge 2 commits into
Open
feat: fall back to type checker for non-generic type aliases with unresolvable utility types#2513puckey wants to merge 2 commits into
puckey wants to merge 2 commits into
Conversation
ec0c347 to
aa0ad32
Compare
arthurfiorette
requested changes
Mar 30, 2026
arthurfiorette
left a comment
Collaborator
There was a problem hiding this comment.
each unit test takes a bit to run, can you join your tests into less files? No need to have 5 separate file tests for this PR. Also, only add tsconfig in the tests you need.
aa0ad32 to
e90efcc
Compare
Contributor
Author
|
Merged tests, rebased on next and ran tests. |
arthurfiorette
approved these changes
Jun 18, 2026
auto-merge was automatically disabled
June 19, 2026 07:37
Head branch was pushed to by a user without write access
Contributor
Author
|
Same TS6 |
…esolvable utility types - Pre-resolve non-generic type aliases via the type checker before AST parsing - Fall back to resolved type node when AST parsing produces errored UnknownType - Use InTypeAlias and NoTruncation flags to produce complete synthesized nodes - Set parent references on synthesized nodes lazily (only on fallback) - Wrap fallback in try/catch with quality check to prevent degraded schemas - Handle unresolved ReferenceType in hasErroredUnknown - Add test for Awaited<ReturnType<typeof fn>> with object, array, union, nested-ref, primitive, and function-property return types
Use non-deprecated moduleResolution (node -> bundler) and regenerate schema.json for the TS6 union member ordering of string | undefined.
0e5f3d4 to
c2719ae
Compare
Contributor
Author
|
Rebased onto |
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.
Summary
Awaited<ReturnType<typeof fn>>, AST-based parsing can fail when utility types can't be resolved structurally, producing"Failed to correctly infer type"UnknownTypeis detectedInTypeAliasandNoTruncationflags to produce complete synthesized nodesTest plan
type-awaited-return-type-inferred— object return typetype-awaited-return-type-array— array return typetype-awaited-return-type-union— discriminated union return typetype-awaited-return-type-nested-ref— nested interface referencetype-awaited-return-type-primitive—string | undefinedreturn typetype-awaited-return-type-break— function-valued properties (graceful degradation)