Skip to content

Fix grammar checking for in and out modifiers in @template tags#4100

Merged
ahejlsberg merged 2 commits into
mainfrom
fix-4076
May 30, 2026
Merged

Fix grammar checking for in and out modifiers in @template tags#4100
ahejlsberg merged 2 commits into
mainfrom
fix-4076

Conversation

@ahejlsberg
Copy link
Copy Markdown
Member

Fixes #4076.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes TypeScript-Go’s grammar checking to correctly allow in/out modifiers on type parameters originating from JSDoc @template tags when those templates are attached to JSDoc-derived type aliases (e.g. @typedef), matching upstream TypeScript behavior.

Changes:

  • Update checkGrammarModifiers to treat ast.KindJSTypeAliasDeclaration the same as a regular type alias for validating in/out modifiers.
  • Remove the unused isJSDocTypedefTag stub and related commented-out porting notes.
  • Update submodule conformance baselines for jsdocTemplateTag8 to remove the spurious TS1274 errors (and delete the now-empty .diff).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
internal/checker/grammarchecks.go Accept IsTypeOrJSTypeAliasDeclaration as a valid container for in/out modifier grammar checks on type parameters.
testdata/baselines/reference/submodule/conformance/jsdocTemplateTag8.errors.txt Baseline updated to reflect removal of incorrect TS1274 diagnostics.
testdata/baselines/reference/submodule/conformance/jsdocTemplateTag8.errors.txt.diff Removed since there is no longer a difference vs the reference baseline for this test.

@ahejlsberg ahejlsberg added this pull request to the merge queue May 30, 2026
Merged via the queue into main with commit 73868c8 May 30, 2026
22 checks passed
@ahejlsberg ahejlsberg deleted the fix-4076 branch May 30, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected errors for modifiers on @template type parameters

3 participants