You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const directionUp: symbol = Symbol();
const directionDown: symbol = Symbol();
const directionLeft: symbol = Symbol();
const directionRight: symbol = Symbol();
it make more sense to use enum type(shown below):
enum Direction {
Up = Symbol(),
Down = Symbol(),
Left = Symbol(),
Right = Symbol(),
}
Why TypeScript does not allow using symbol type with enum type?
The text was updated successfully, but these errors were encountered:
shamhub
changed the title
Why Symbol is not allowed in enum?
TS2322: Why Symbol is not allowed in enum?
May 12, 2018
shamhub
changed the title
TS2322: Why Symbol is not allowed in enum?
TS2322: Why symbol type is not allowed with enum type?
May 12, 2018
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
Instead of using constant variable declarations,
it make more sense to use
enum
type(shown below):Why TypeScript does not allow using
symbol
type withenum
type?The text was updated successfully, but these errors were encountered: