-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
Effort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Help WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
Hi,
Constants aren't evaluate to access and cast properly union types values:
const ID = 0;
const NAME = 1;
let data: [number, string] = [0, "bob"];
// This need cast to compile
let id: number = data[ID];
let name: string = data[NAME];
Is there a reason why it's not supported ?
Regards,
Sébastien
Metadata
Metadata
Assignees
Labels
Effort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Help WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript