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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Status: Not started
Development

Successfully merging this pull request may close these issues.

enum member key should reject bigint
2 participants