Closed
Description
TypeScript Version: 2.4.1
Code
// A *self-contained* demonstration of the problem follows...
class Animal {
a: string;
}
class Dog extends Animal {
b: string;
}
function test(func: (p: Dog) => any): any;
function test(func: (p: Animal) => any): any;
function test(func: (p: Animal) => any): any {
return undefined;
}
Expected behavior:
No TS2394 Compiler error
Actual behavior:
a TS2394 Compiler error for this line:
function test(func: (p: Dog) => any): any;
Changing function definition the below resolves the compile error:
function test(func: (p: any) => any): any {