Repository navigation
Report implicit any errors in function type binding patterns during checking - #64856
Open
Mateusz Burzyński (Andarist) wants to merge 1 commit into
Open
Mateusz Burzyński (Andarist) wants to merge 1 commit into
Mateusz Burzyński (Andarist) wants to merge 1 commit into
Conversation
Contributor
|
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
| c.renamedBindingElementsInTypes = append(c.renamedBindingElementsInTypes, node) | ||
| // Still resolve the type like the end of this function does for every other declaration, | ||
| // so implicit any errors are reported by checking instead of by whatever asks for the type later | ||
| c.getTypeOfSymbol(c.getSymbolOfDeclaration(node)) |
Contributor
Author
There was a problem hiding this comment.
there are some new errors here - but just because this test uses noEmit: true. So this lies in the same area as the fixed flake really, the emit variant of this test would already show those errors
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The localized fix follows existing type-resolution behavior, includes regression coverage, and has no identified blocking issues.
No open issues 🎉
What changed in this PR
Stabilizes implicit-any diagnostics for function-type binding patterns by resolving their types during checking, addressing the flake linked in #64849.
Changes:
- Resolves renamed binding elements before the checker returns early.
- Adds TypeScript and JavaScript/JSDoc regression tests with baselines.
- Updates syntax-error baselines for the additional diagnostics.
| File | Description |
|---|---|
tsc/testdata/tests/cases/compiler/noFlakyDiagnosticsBindingPatternInFunctionType2.ts |
Adds JavaScript/JSDoc regression coverage. |
tsc/testdata/tests/cases/compiler/noFlakyDiagnosticsBindingPatternInFunctionType1.ts |
Adds TypeScript regression coverage. |
tsc/testdata/baselines/reference/compiler/parametersSyntaxErrorNoCrash3.errors.txt |
Records additional implicit-any errors. |
tsc/testdata/baselines/reference/compiler/parametersSyntaxErrorNoCrash2.errors.txt |
Records additional implicit-any errors. |
tsc/testdata/baselines/reference/compiler/parametersSyntaxErrorNoCrash1.errors.txt |
Records an additional implicit-any error. |
tsc/testdata/baselines/reference/compiler/noFlakyDiagnosticsBindingPatternInFunctionType2.types |
Captures JSDoc type results. |
tsc/testdata/baselines/reference/compiler/noFlakyDiagnosticsBindingPatternInFunctionType2.symbols |
Captures JSDoc symbol results. |
tsc/testdata/baselines/reference/compiler/noFlakyDiagnosticsBindingPatternInFunctionType2.js |
Captures JavaScript and declaration output. |
tsc/testdata/baselines/reference/compiler/noFlakyDiagnosticsBindingPatternInFunctionType2.errors.txt |
Captures JSDoc regression diagnostics. |
tsc/testdata/baselines/reference/compiler/noFlakyDiagnosticsBindingPatternInFunctionType1.types |
Captures TypeScript type results. |
tsc/testdata/baselines/reference/compiler/noFlakyDiagnosticsBindingPatternInFunctionType1.symbols |
Captures TypeScript symbol results. |
tsc/testdata/baselines/reference/compiler/noFlakyDiagnosticsBindingPatternInFunctionType1.js |
Captures JavaScript and declaration output. |
tsc/testdata/baselines/reference/compiler/noFlakyDiagnosticsBindingPatternInFunctionType1.errors.txt |
Captures TypeScript regression diagnostics. |
tsc/internal/checker/checker.go |
Resolves binding-element types during checking. |
Review effort: Balanced
This branch has not been deployed
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.
fixes flake reported here: #64849 (comment)