Skip to content

String Enum v2.4.1 #17057

Closed
Closed
@acopalipsis

Description

@acopalipsis
enum Enumeration {
    A = "value",
    B // Enum member must have initializer.
}

It should be or it's a bug?

Activity

ikatyang

ikatyang commented on Jul 10, 2017

@ikatyang
Contributor

This is Working as Intended, see #15486 for more detail.

Enum members with string literal values must always specify an initializer, but enum members with numeric literal values may omit the initializer provided it is the first member or the preceding member has a numeric value.

locked and limited conversation to collaborators on Jun 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @RyanCavanaugh@ikatyang@acopalipsis

        Issue actions

          String Enum v2.4.1 · Issue #17057 · microsoft/TypeScript