Skip to content

Imported const enum is not inlined in generated code #16671

@Jessidhia

Description

@Jessidhia

TypeScript Version: 2.4.0

Code

// a.ts
export const enum Foo {
  Bar = 'bar'
}

// b.ts
import { Foo } from './a'

Foo.Bar // TypeError or ReferenceError, depending on how it's compiled

Expected behavior:
Foo.Bar to be replaced with 'bar'

Actual behavior:
The import is deleted and Foo.Bar is left as is

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions