TypeScript/tests/baselines/reference/typeParameterAssignmentWithConstraints.errors.txt

14 lines
748 B
Plaintext
Raw Normal View History

tests/cases/compiler/typeParameterAssignmentWithConstraints.ts(1,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
2014-11-05 21:26:03 +01:00
tests/cases/compiler/typeParameterAssignmentWithConstraints.ts(4,5): error TS2322: Type 'B' is not assignable to type 'A'.
2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/typeParameterAssignmentWithConstraints.ts (2 errors) ====
function f<A, B extends A>() {
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
2014-07-13 01:04:16 +02:00
var a: A;
var b: B;
a = b; // Error: Can't convert B to A
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'B' is not assignable to type 'A'.
2014-07-13 01:04:16 +02:00
}