TypeScript Version: 3.2.0-dev.20181018
Search Terms:
Code
declarefunctionf<T>(cf: (()=>T)|((x: T)=>boolean)): void;declarefunctionmyFn(): Date;declarefunctionmyFn(n: number): void;f<Date>(myFn);// worksf(myFn);// error
Expected behavior:
No error, as in typescript@3.1.
Actual behavior:
src/a.ts:7:3-errorTS2345: Argumentoftype'{ (): Date; (n: number): void; }'isnotassignabletoparameteroftype'(() => number) | ((x: number) => boolean)'.Type'{ (): Date; (n: number): void; }'isnotassignabletotype'() => number'.Type'Date'isnotassignabletotype'number'.7f(myFn);// errorLooks like this was introduced by #27028. Discovered in bluebird on DefinitelyTyped -- in that case it had to do with type CatchFilter<E> = (new (...args: any[]) => E) | ((error: E) => boolean) | (object & E); which unions a construct and call signature which more clearly should be separate.
TypeScript Version: 3.2.0-dev.20181018
Search Terms:
Code
Expected behavior:
No error, as in
typescript@3.1.Actual behavior:
Looks like this was introduced by #27028. Discovered in
bluebirdon DefinitelyTyped -- in that case it had to do withtype CatchFilter<E> = (new (...args: any[]) => E) | ((error: E) => boolean) | (object & E);which unions a construct and call signature which more clearly should be separate.