- Notifications
You must be signed in to change notification settings - Fork 13k
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.7.0-dev.20171124
Code
enum Item { potato = "potato", cucumber = "cucumber" } // inferred type is `() => Item` const getPotato1 = () => Item.potato; // type assertion works const getPotato2: () => Item.potato = () => Item.potato;
Expected behavior:
Type of getPotato1
should be inferred as () => Item.potato
.
Actual behavior:
Type of getPotato1
is "needlessly" widened to () => Item
.
cc @OliverJAsh
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