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

10 lines
405 B
Plaintext
Raw Normal View History

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