-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Labels
BugA bug in TypeScriptA bug in TypeScript
Milestone
Description
TypeScript Version: 3.2.2
Search Terms:
void parameter type extends generic
Code
function works1(n: number, b: void) { }
works1(12);
function works2(n: number, b: 1 extends 1 ? void : number) { }
works2(12);
function fails<T>(n: number, b: T extends 1 ? void : number) { }
fails<2>(12, 2); // works, requires both params
fails<1>(12); // fails, requires 2 parameters even though second param is void
Expected behavior:
That I can ignore the second parameter since its void
Actual behavior:
Ts tells me I am missing a parameter
garkin, robbiespeed, raleksandar, jcalz, ExE-Boss and 22 more
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScript