2014-10-28 08:28:59 +01:00
|
|
|
tests/cases/compiler/generics4.ts(7,1): error TS2323: Type 'C<Y>' is not assignable to type 'C<X>'.
|
|
|
|
Type 'Y' is not assignable to type 'X'.
|
|
|
|
Types of property 'f' are incompatible.
|
|
|
|
Type '() => boolean' is not assignable to type '() => string'.
|
2014-09-12 22:35:07 +02:00
|
|
|
Type 'boolean' is not assignable to type 'string'.
|
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/generics4.ts (1 errors) ====
|
|
|
|
class C<T> { private x: T; }
|
|
|
|
interface X { f(): string; }
|
|
|
|
interface Y { f(): boolean; }
|
|
|
|
var a: C<X>;
|
|
|
|
var b: C<Y>;
|
|
|
|
|
|
|
|
a = b; // Not ok - return types of "f" are different
|
|
|
|
~
|
2014-10-28 08:28:59 +01:00
|
|
|
!!! error TS2323: Type 'C<Y>' is not assignable to type 'C<X>'.
|
|
|
|
!!! error TS2323: Type 'Y' is not assignable to type 'X'.
|
|
|
|
!!! error TS2323: Types of property 'f' are incompatible.
|
|
|
|
!!! error TS2323: Type '() => boolean' is not assignable to type '() => string'.
|
|
|
|
!!! error TS2323: Type 'boolean' is not assignable to type 'string'.
|