Skip to content

const/non-const enum cleanup #2183

Closed
Closed

Description

Key points from discussion from this morning:

  1. Assume all non-ambient members of non-const enums are computed (even those initialized with literals), both for inlining purposes and for .d.ts generation purposes
  2. Continue to aggressively compute initializer expressions in both const and non-const enums
  3. Ambient non-const enums preserve existing behavior (computed iff there is no initializer)
  4. Continue to have --preserveConstEnums flag, which causes emit of the lookup object for const enums but does not change inlining

Tag @ahejlsberg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    CommittedThe team has roadmapped this issueFixedA PR has been merged for this issueSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions