==== tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts (4 errors) ==== interface Comparable { compareTo(other: T): number; } interface I { x: Comparable; } interface K { x: A; } class A implements Comparable { compareTo(other: T) { return 1; } } var z = { x: new A() }; var a1: I = { x: new A() }; ~~ !!! Type '{ x: A; }' is not assignable to type 'I': !!! Types of property 'x' are incompatible: !!! Type 'A' is not assignable to type 'Comparable': !!! Types of property 'compareTo' are incompatible: !!! Type '(other: number) => number' is not assignable to type '(other: string) => number': !!! Types of parameters 'other' and 'other' are incompatible: !!! Type 'number' is not assignable to type 'string'. var a2: I = function (): { x: A } { ~~ !!! Type '{ x: A; }' is not assignable to type 'I': !!! Types of property 'x' are incompatible: !!! Type 'A' is not assignable to type 'Comparable': !!! Types of property 'compareTo' are incompatible: !!! Type '(other: number) => number' is not assignable to type '(other: string) => number': !!! Types of parameters 'other' and 'other' are incompatible: !!! Type 'number' is not assignable to type 'string'. var z = { x: new A() }; return z; } (); var a3: I = z; ~~ !!! Type '{ x: A; }' is not assignable to type 'I': !!! Types of property 'x' are incompatible: !!! Type 'A' is not assignable to type 'Comparable': !!! Types of property 'compareTo' are incompatible: !!! Type '(other: number) => number' is not assignable to type '(other: string) => number': !!! Types of parameters 'other' and 'other' are incompatible: !!! Type 'number' is not assignable to type 'string'. var a4: I = >z; ~~ !!! Type 'K' is not assignable to type 'I': !!! Types of property 'x' are incompatible: !!! Type 'A' is not assignable to type 'Comparable': !!! Types of property 'compareTo' are incompatible: !!! Type '(other: number) => number' is not assignable to type '(other: string) => number': !!! Types of parameters 'other' and 'other' are incompatible: !!! Type 'number' is not assignable to type 'string'.