Skip to content

fix(checker): report error when using bigint as enum key #61777

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 5, 2025

Conversation

magic-akari
Copy link
Contributor

@Copilot Copilot AI review requested due to automatic review settings May 28, 2025 06:54
@github-project-automation github-project-automation bot moved this to Not started in PR Backlog May 28, 2025
@typescript-bot typescript-bot added For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels May 28, 2025
Copy link

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

This PR introduces a diagnostic change in the checker to report an error when a bigint literal is used as an enum key, and updates tests and baseline files accordingly.

  • Added a test case (enumWithBugint.ts) that defines an enum using a bigint literal as a key.
  • Updated the TypeScript checker logic to emit an error for numeric and BigInt literals used as enum member names.
  • Refreshed baseline files (types, symbols, JS, errors) to reflect the updated diagnostic messages.

Reviewed Changes

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

File Description
tests/cases/compiler/enumWithBugint.ts New test case to verify error reporting for bigint enum keys
tests/baselines/reference/enumWithBugint.{types,symbols,js,errors.txt} Updated baselines to accommodate the new error message
src/compiler/checker.ts Added error checking for BigInt literals in enum member names

@github-project-automation github-project-automation bot moved this from Not started to Needs merge in PR Backlog Jun 5, 2025
@jakebailey jakebailey enabled auto-merge (squash) June 5, 2025 23:37
@jakebailey jakebailey merged commit ac03ba4 into microsoft:main Jun 5, 2025
32 checks passed
@typescript-bot typescript-bot removed the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Jun 5, 2025
@github-project-automation github-project-automation bot moved this from Needs merge to Done in PR Backlog Jun 5, 2025
@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Jun 5, 2025
@magic-akari magic-akari deleted the fix/issue-61772 branch June 6, 2025 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

enum member key should reject bigint
3 participants