-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptSpecIssues related to the TypeScript language specificationIssues related to the TypeScript language specification
Milestone
Description
Hi, don't understand why this code doesn't compile:
function f<T>(value: [string, T]): T {
return value[1];
}
var h: boolean = f(["string", true]);error TS2323: Type 'string | boolean' is not assignable to type 'boolean'.
Type 'string' is not assignable to type 'boolean'.
Someone can help me ?
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptSpecIssues related to the TypeScript language specificationIssues related to the TypeScript language specification