Skip to content

Cannot export const enum in Export Declaration #33060

Closed
@EvanCahill

Description

@EvanCahill

TypeScript Version: 3.6.1-rc

Search Terms: const enum export declaration TS2475

Code

// test.ts
const enum Test {}
export { Test };

Expected behavior:
The above code compiles without errors.

Actual behavior:

test.ts:2:10 - error TS2475: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query.

Playground Link:
http://www.typescriptlang.org/play/#code/MYewdgzgLgBApmArgWxgFTtGBvAvgKDgA8AHEAJ1m3U1lwG4g

Related Issues:
N/A

Metadata

Metadata

Assignees

Labels

Needs InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions