fix(4087): fix declaration emit modifiers for constructor types#4114
Queued
a-tarasyuk wants to merge 2 commits into
Queued
fix(4087): fix declaration emit modifiers for constructor types#4114a-tarasyuk wants to merge 2 commits into
a-tarasyuk wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
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
@declarationtest case coveringvar Foo: new () => numberalongsideinterface Fooin 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.GetCombinedModifierFlagsinstead 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. |
jakebailey
approved these changes
Jun 1, 2026
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 #4087