checker: use destructuring annotations for binding types - #14
Merged
Merged
Conversation
Contributor
|
Findings apply to both #13 and #14: they point to the same commit/diff.
Verification run on the PR branch: |
…lizers The array destructuring path only used the declared annotation type when the initializer was literally an array literal, falling back to the initializer's own (possibly any/widened) type otherwise. Object destructuring already resolved binding types from the annotation unconditionally; bring array destructuring in line so e.g. `let [a, b]: [number, string] = someAnyValue` types `a`/`b` from the annotation instead of losing them to `any`.
nooga
marked this pull request as ready for review
July 13, 2026 23:19
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
Teach destructuring declarations to use explicit annotations as the binding source type.
Compat impact
Published TypeScript snapshot:
3341/4928 -> 3342/4928(+1).Against the exact local pre-change full dump used for this branch, the best observed push-hook result was
3340/4928 -> 3342/4928(+2), with suite-order flakiness noted in the TypeScript runner.Focused wins:
types/tuple/tupleElementTypes1.tscontrolFlow/controlFlowDestructuringDeclaration.tsValidation
go build ./...go build -o paserati-testtsc ./cmd/paserati-testtscgo test ./tests -run TestScriptspaserati-testtscdiffs fortypes/tupleandcontrolFlowpaserati-testtscdiff against the local pre-change dump