-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
cc @ahejlsberg
TypeScript Version: master
Code
declare class C {
static a(f: (a: C) => C): void;
static b(): (a: C) => C;
}
declare class D extends C {
private p: void;
static a(f: (a: D) => D): void;
static b(): (a: D) => D;
}
Expected behavior:
no error or both a
and b
make an error.
Actual behavior:
$ node built/local/tsc.js index.d.ts --noEmit --strictFunctionTypes
index.d.ts(5,15): error TS2417: Class static side 'typeof D' incorrectly extends base class static side 'typeof C'.
Types of property 'b' are incompatible.
Type '() => (a: D) => D' is not assignable to type '() => (a: C) => C'.
Type '(a: D) => D' is not assignable to type '(a: C) => C'.
Types of parameters 'a' and 'a' are incompatible.
Type 'C' is not assignable to type 'D'.
Property 'p' is missing in type 'C'.
SlurpTheo
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue