Skip to content

fix(4087): fix declaration emit modifiers for constructor types#4114

Queued
a-tarasyuk wants to merge 2 commits into
microsoft:mainfrom
a-tarasyuk:fix/4087
Queued

fix(4087): fix declaration emit modifiers for constructor types#4114
a-tarasyuk wants to merge 2 commits into
microsoft:mainfrom
a-tarasyuk:fix/4087

Conversation

@a-tarasyuk
Copy link
Copy Markdown
Contributor

Fixes #4087

Copilot AI review requested due to automatic review settings May 31, 2026 06:25
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

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new compiler test case for declaration emit involving a constructor-typed var that shares a name with an interface, and updates declaration transformer modifier-flag computation to use combined AST modifier flags directly.

Changes:

  • Added a new @declaration test case covering var Foo: new () => number alongside interface Foo in a namespace.
  • Added new reference baselines for types, symbols, and JS/d.ts outputs for the new test.
  • Updated modifier flag masking / detection to use ast.GetCombinedModifierFlags instead of host “effective” flags.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
testdata/tests/cases/compiler/declarationEmitConstructorType.ts New regression test exercising declaration emit for constructor-typed variable vs interface name collision.
testdata/baselines/reference/compiler/declarationEmitConstructorType.types Expected type baseline for the new test.
testdata/baselines/reference/compiler/declarationEmitConstructorType.symbols Expected symbol baseline for the new test.
testdata/baselines/reference/compiler/declarationEmitConstructorType.js Expected JS + d.ts baseline for the new test.
internal/transformers/declarations/util.go Changes modifier flag masking to derive flags directly from AST combined modifiers.
internal/transformers/declarations/transform.go Changes modifier comparison to use combined modifiers and updates call into maskModifierFlags.

Comment thread internal/transformers/declarations/transform.go Outdated
Comment thread internal/transformers/declarations/util.go Outdated
@jakebailey jakebailey added this pull request to the merge queue Jun 1, 2026
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.

Spurious export modifier injected into a constructor type in .d.ts output

3 participants