Skip to content

enum errorΒ #57672

Closed
Closed
@tangjfn

Description

@tangjfn

πŸ”Ž Search Terms

enum

πŸ•— Version & Regression Information

TypeScript 5.4.x
5.3.x is OK

⏯ Playground Link

https://www.typescriptlang.org/play?ts=5.4.1-rc#code/MYewdgzgLgBApmArgWxgQRgbwFAzzAOQEMCYBeGARgBpd8BJMAMwEswWoBPcmAJmwC+QA

πŸ’» Code

const enum A {
    NaN = 1,
    Infinity = 2
}

πŸ™ Actual behavior

An enum member cannot have a numeric name.(2452)

πŸ™‚ Expected behavior

no error here

Additional information about the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions