Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Qualify enum member names when referencing in value position#62034

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
RyanCavanaugh wants to merge2 commits intomicrosoft:main
base:main
Choose a base branch
Loading
fromRyanCavanaugh:fix61944

Conversation

RyanCavanaugh
Copy link
Member

Fixes#61944

This doesn't have any observable effects (AFAICT) on the forms like

enumFoo{bar,baz=bar}

because we never try to declaration emit those in symbolic form - for a literal value ofbar, they're both= 0; for a computed value, you don't see the initializer onbaz at all

@CopilotCopilotAI review requested due to automatic review settingsJuly 10, 2025 07:01
@typescript-bottypescript-bot added Author: Team For Milestone BugPRs that fix a bug with a specific milestone labelsJul 10, 2025
Copy link

@CopilotCopilotAI 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

This PR fixes issue#61944 by ensuring that enum member names are qualified when referenced in value positions during declaration emission. The change prevents TypeScript from emitting invalid unqualified enum member references in declaration files.

Key changes:

  • Modified the symbol qualification logic in the type checker to force qualification for enum members in value contexts
  • Added a test case to verify the fix works correctly for enum members referenced within namespaces

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
src/compiler/checker.tsUpdated symbol qualification logic to force qualification for enum members in value contexts
tests/cases/compiler/invalidUnqualifiedEnum.tsAdded test case with enum and namespace scenario that would previously emit invalid code
tests/baselines/reference/invalidUnqualifiedEnum.typesTest baseline for type information output
tests/baselines/reference/invalidUnqualifiedEnum.symbolsTest baseline for symbol resolution output
tests/baselines/reference/invalidUnqualifiedEnum.jsTest baseline for compiled JavaScript and declaration file output

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@weswighamweswighamAwaiting requested review from weswigham

At least 1 approving review is required to merge this pull request.

Assignees

@RyanCavanaughRyanCavanaugh

Labels
Author: TeamFor Milestone BugPRs that fix a bug with a specific milestone
Projects
Status: Not started
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Incorrect type declarations for a constant inside a namespace merged with an enum
2 participants
@RyanCavanaugh@typescript-bot

[8]ページ先頭

©2009-2025 Movatter.jp