TypeScript/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.errors.txt
2014-09-11 16:11:08 -07:00

17 lines
482 B
Plaintext

==== tests/cases/compiler/genericDerivedTypeWithSpecializedBase.ts (1 errors) ====
class A<T> {
x: T;
}
class B<U> extends A<string> {
y: U;
}
var x: A<number>;
var y: B<number>;
x = y; // error
~
!!! error TS2322: Type 'B<number>' is not assignable to type 'A<number>':
!!! error TS2322: Types of property 'x' are incompatible:
!!! error TS2322: Type 'string' is not assignable to type 'number'.