Use semantic type identity for JSDoc augments checks - #4889
Use semantic type identity for JSDoc augments checks#4889Wesley Wigham (weswigham) with Copilot wants to merge 8 commits into
Conversation
Co-authored-by: weswigham <2932786+weswigham@users.noreply.github.com>
Co-authored-by: weswigham <2932786+weswigham@users.noreply.github.com>
Co-authored-by: weswigham <2932786+weswigham@users.noreply.github.com>
|
Actually Copilot also limit the check to JS files only - we shouldn't be issuing this (lint?) in |
There was a problem hiding this comment.
Pull request overview
Updates JSDoc inheritance validation to compare resolved types, fixing false TS8023 diagnostics for constructor aliases.
Changes:
- Moves validation from grammar checks into semantic class checking.
- Adds alias-based regression coverage.
- Updates affected diagnostic and type baselines.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
internal/checker/checker.go |
Adds semantic augments/extends type comparison. |
internal/checker/grammarchecks.go |
Removes text-based grammar validation. |
testdata/tests/cases/compiler/jsdocAugmentsAliasExtends.ts |
Adds constructor-alias regression test. |
testdata/tests/cases/compiler/jsdocExtendsClauseMismatch.ts |
Makes mismatched classes structurally distinct. |
testdata/baselines/reference/compiler/jsdocAugmentsAliasExtends.types |
Records regression-test types. |
testdata/baselines/reference/compiler/jsdocAugmentsAliasExtends.symbols |
Records regression-test symbols. |
testdata/baselines/reference/compiler/jsdocExtendsClauseMismatch.errors.txt |
Updates mismatch diagnostic fixture. |
testdata/baselines/reference/compiler/jsdocExtendsClauseMismatch.types |
Updates mismatch type baseline. |
testdata/baselines/reference/compiler/jsdocExtendsClauseMismatch.symbols |
Updates mismatch symbol baseline. |
testdata/baselines/reference/compiler/superCallInJSWithWrongBaseTypeArgumentCount2(strict=true).errors.txt |
Records semantic JSDoc generic diagnostics. |
testdata/baselines/reference/submodule/compiler/jsExtendsImplicitAny.errors.txt |
Updates implicit-any diagnostics. |
testdata/baselines/reference/submodule/compiler/jsExtendsImplicitAny.errors.txt.diff |
Records upstream baseline differences. |
testdata/baselines/reference/submodule/conformance/extendsTagEmit.errors.txt |
Adds unresolved JSDoc type diagnostic. |
testdata/baselines/reference/submodule/conformance/extendsTagEmit.errors.txt.diff |
Removes the resolved baseline difference. |
testdata/baselines/reference/submodule/conformance/jsdocAugments_nameMismatch.errors.txt |
Removes structurally identical mismatch output. |
testdata/baselines/reference/submodule/conformance/jsdocAugments_nameMismatch.errors.txt.diff |
Records the resulting upstream difference. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: weswigham <2932786+weswigham@users.noreply.github.com>
|
|
||
|
|
||
| ==== /b.js (1 errors) ==== | ||
| class A {} |
There was a problem hiding this comment.
Copilot adjust this test's input to match the intent (testing the augments error) by making A and B not structurally identical.
There was a problem hiding this comment.
The test input is in the pinned microsoft/TypeScript submodule. I cannot persist that source change here without an upstream TypeScript commit to update the submodule pointer to; a baseline-only update would fail in a fresh checkout. Please provide or land the upstream revision, and I can pin it and refresh the baselines.
Co-authored-by: weswigham <2932786+weswigham@users.noreply.github.com>
This reverts commit 5098c0b. Co-authored-by: weswigham <2932786+weswigham@users.noreply.github.com>
@augments/@extendsvalidation compared raw identifier text, so declaration emit like this incorrectly reported TS8023 even when theextendstarget was an alias of the augmented base:Checker behavior
isTypeIdenticalTo.Diagnostics and baselines
Regression coverage
@augments {Base}withextendsthrough a constructor alias.@augmentsJSDoc tag causes compilation error in generated declaration file #4875