-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Description
TypeScript Version: 2.4.0
Code
enum Colors {
Red = "RED",
Green = "GREEN",
Blue = "BLUE",
}
const c1: Colors = Colors.Red;
const c2: Colors = "RED";
Expected behavior:
I'd expect both lines with c1
and c2
to work but only the first compiles.
Actual behavior:
[ts] Type '"RED"' is not assignable to type 'Colors'.
const c2: Colors
m1gu3l, choegyumin, yoz, tonyxiao, jddxf and 1 more
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug