fix(64627): reject deferred imports without namespace bindings - #64640
Open
Oleksandr Tarasiuk (a-tarasyuk) wants to merge 2 commits into
Open
Oleksandr Tarasiuk (a-tarasyuk) wants to merge 2 commits into
Oleksandr Tarasiuk (a-tarasyuk) wants to merge 2 commits into
Conversation
Copilot started reviewing on behalf of
Oleksandr Tarasiuk (a-tarasyuk)
October 5, 2026 10:33
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new diagnostic is filtered out for ordinary JavaScript files when checkJs is unset.
Review effort: Balanced
Findings: 1
What changed in this PR
Addresses #64627 by preserving deferred import clauses without bindings so the compiler can report a namespace-binding error.
Changes:
- Retains empty deferred import clauses and adds TS18116.
- Simplifies default-import helper detection.
- Expands TypeScript and JavaScript coverage across ESNext and CommonJS.
| File | Description |
|---|---|
tsc/testdata/tests/cases/conformance/importDefer/importDeferInvalidDefault.ts |
Adds missing-binding cases and module variants. |
tsc/testdata/baselines/reference/conformance/importDeferInvalidDefault(module=esnext).types |
Records ESNext types. |
tsc/testdata/baselines/reference/conformance/importDeferInvalidDefault(module=esnext).symbols |
Records ESNext symbols. |
tsc/testdata/baselines/reference/conformance/importDeferInvalidDefault(module=esnext).js |
Updates ESNext emit expectations. |
tsc/testdata/baselines/reference/conformance/importDeferInvalidDefault(module=esnext).errors.txt |
Records ESNext diagnostics. |
tsc/testdata/baselines/reference/conformance/importDeferInvalidDefault(module=commonjs).types |
Updates CommonJS types. |
tsc/testdata/baselines/reference/conformance/importDeferInvalidDefault(module=commonjs).symbols |
Updates CommonJS symbols. |
tsc/testdata/baselines/reference/conformance/importDeferInvalidDefault(module=commonjs).js |
Records CommonJS emit expectations. |
tsc/testdata/baselines/reference/conformance/importDeferInvalidDefault(module=commonjs).errors.txt |
Records CommonJS diagnostics. |
tsc/testdata/baselines/reference/conformance/importDeferInvalidDefault.errors.txt |
Removes the unparameterized diagnostic baseline. |
tsc/internal/transformers/moduletransforms/externalmoduleinfo.go |
Simplifies default-helper detection. |
tsc/internal/parser/parser.go |
Preserves empty deferred import clauses. |
tsc/internal/diagnostics/diagnostics_generated.go |
Registers TS18116. |
tsc/internal/diagnostics/diagnosticMessages.json |
Defines the namespace-binding diagnostic. |
tsc/internal/diagnostics/diagnosticMessages.generated.json |
Adds the generated diagnostic message. |
tsc/internal/checker/grammarchecks.go |
Rejects deferred imports without bindings. |
Files not reviewed (1)
- tsc/internal/diagnostics/diagnostics_generated.go: Generated file
Oleksandr Tarasiuk (a-tarasyuk)
force-pushed
the
fix/64627
branch
from
October 5, 2026 10:51
ee16a8b to
afe0a2c
Compare
Copilot started reviewing on behalf of
Oleksandr Tarasiuk (a-tarasyuk)
October 5, 2026 11:01
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused parser and diagnostic changes have matching regression baselines, with no unresolved blocking issues.
Review effort: Balanced
Findings: None
Resolved since last review (1)
Files not reviewed (1)
- tsc/internal/diagnostics/diagnostics_generated.go: Generated file
Ryan Cavanaugh (RyanCavanaugh)
approved these changes
Oct 5, 2026
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 #64627