Closed
Description
Considering how const enum
operates at compile-time, it seems odd that the following is not valid:
const enum Ids {
alpha = 1
}
interface Foo {
[Ids.alpha]: string
}
when it should be precisely equivalent to:
interface Foo {
[1]: string
}
which compiles just fine.
Proposal
Allow const enum
values to be used in computed property specifiers in interface declarations and type literals, just as well-known symbols are today.