Repository navigation
Fix flaky diagnostic on JS constructor-defined properties - #64646
Merged
Wesley Wigham (weswigham) merged 1 commit intoOct 6, 2026
Merged
Wesley Wigham (weswigham) merged 1 commit into
Wesley Wigham (weswigham) merged 1 commit into
Conversation
Wesley Wigham (weswigham)
requested review from
Daniel Rosenwasser (DanielRosenwasser) and
Jake Bailey (jakebailey)
and
a balanced review from Copilot
October 5, 2026 16:49
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused checker change is comprehensively covered across class forms, inference cases, and compiler-option combinations.
Review effort: Balanced
Findings: None
What changed in this PR
Ensures JavaScript constructor-defined properties are consistently type-checked, eliminating emit-dependent diagnostic behavior.
Changes:
- Explicitly resolves constructor-declared property types for class declarations and expressions.
- Adds regression coverage across emit and strict-null-check configurations.
| File | Description |
|---|---|
tsc/internal/checker/checker.go |
Checks constructor-defined JavaScript properties consistently. |
tsc/testdata/tests/cases/compiler/flakyDiagnosticsJsClassPropertyInitializedToUndefined.ts |
Adds regression scenarios for property inference and diagnostics. |
...(noemit=true,strictnullchecks=true).types |
Records strict/no-emit inferred types. |
...(noemit=true,strictnullchecks=true).symbols |
Records strict/no-emit symbols. |
...(noemit=true,strictnullchecks=true).errors.txt |
Records strict/no-emit diagnostics. |
...(noemit=true,strictnullchecks=false).types |
Records non-strict/no-emit inferred types. |
...(noemit=true,strictnullchecks=false).symbols |
Records non-strict/no-emit symbols. |
...(noemit=true,strictnullchecks=false).errors.txt |
Records non-strict/no-emit diagnostics. |
...(noemit=false,strictnullchecks=true).types |
Records strict/emit inferred types. |
...(noemit=false,strictnullchecks=true).symbols |
Records strict/emit symbols. |
...(noemit=false,strictnullchecks=true).js |
Records strict JavaScript and declaration emit. |
...(noemit=false,strictnullchecks=true).errors.txt |
Records strict/emit diagnostics. |
...(noemit=false,strictnullchecks=false).types |
Records non-strict/emit inferred types. |
...(noemit=false,strictnullchecks=false).symbols |
Records non-strict/emit symbols. |
...(noemit=false,strictnullchecks=false).js |
Records non-strict JavaScript and declaration emit. |
...(noemit=false,strictnullchecks=false).errors.txt |
Records non-strict/emit diagnostics. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Jake Bailey (jakebailey)
approved these changes
Oct 5, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 5, 2026
Wesley Wigham (weswigham)
deleted the
fix-js-constructor-property-flaky-diag
branch
October 6, 2026 00:18
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 a flaky diagnostic reported in the server logs. Only some checker entrypoints would trigger
getTypeOfSymbolon constructor-declared properties (implicit any errors from widening the auto type), making the diagnostic depend on if emit had occurred already using a given checker or not.Now we always check them. (Previously, sometimes only their flow type would be calculated - diagnostics wouldn't be issued.)