17 lines
No EOL
440 B
Text
17 lines
No EOL
440 B
Text
==== 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
|
|
~
|
|
!!! Type 'B<number>' is not assignable to type 'A<number>':
|
|
!!! Types of property 'x' are incompatible:
|
|
!!! Type 'string' is not assignable to type 'number'.
|
|
|