Reject exports from global augmentations - #64162
Reject exports from global augmentations#64162Daniel Rosenwasser (DanielRosenwasser) with Copilot wants to merge 3 commits into
Conversation
Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com>
Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
The focused checker fix has regression coverage and no unresolved issues.
Pull request overview
Rejects exports whose bindings originate from declare global augmentations, fixing #64152.
Changes:
- Detect global-augmentation declarations during export validation.
- Add regression coverage and compiler baselines for TS2661.
File summaries
| File | Description |
|---|---|
tsc/testdata/tests/cases/compiler/exportSpecifierForAGlobalAugmentation.ts |
Adds the regression case. |
tsc/testdata/baselines/reference/compiler/exportSpecifierForAGlobalAugmentation.types |
Records inferred types. |
tsc/testdata/baselines/reference/compiler/exportSpecifierForAGlobalAugmentation.symbols |
Records symbol resolution. |
tsc/testdata/baselines/reference/compiler/exportSpecifierForAGlobalAugmentation.js |
Records emitted output. |
tsc/testdata/baselines/reference/compiler/exportSpecifierForAGlobalAugmentation.errors.txt |
Verifies the TS2661 diagnostic. |
tsc/internal/checker/checker.go |
Rejects exports sourced from global augmentations. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
TypeScript Bot (@typescript-bot) test it |
|
Daniel Rosenwasser (@DanielRosenwasser) Here are the results of running the user tests with tsc comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Something interesting changed - please have a look. Details
|
|
Daniel Rosenwasser (@DanielRosenwasser) Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hey Daniel Rosenwasser (@DanielRosenwasser), the results of running the DT tests are ready. Everything looks the same! |
|
Daniel Rosenwasser (@DanielRosenwasser) Here are the results of running the top 400 repos with tsc comparing Everything looks good! |
|
DT is not yet working, I suspect this will break a lot there |
Description
export { XYZ }incorrectly accepted bindings declared in adeclare globalaugmentation.Changes