Skip to content

It is a compile time error for constant enum expressions to be evaluated to NaN or Infinity.  #21959

Closed
@kannanwisen

Description

@kannanwisen

Hi,

The documentation says

It is a compile time error for constant enum expressions to be evaluated to NaN or Infinity.

But the below code does not throw any compile time error

enum FMixed {
    Data1 = 10 + 0.0 / 0.0,
    Data2 = 0 / 0,
    Data3 = 10 / 0.0
}

console.log("FMixed.Data1 is "+FMixed.Data1);

TypeScript Version is 2.7.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issueHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions