TypeScript/tests/baselines/reference/subtypesOfTypeParameterWithConstraints3.errors.txt
2014-10-10 14:41:14 -07:00

21 lines
924 B
Plaintext

tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints3.ts(3,12): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints3.ts (1 errors) ====
// checking whether other types are subtypes of type parameters with constraints
function f<T extends U, U, V>(t: T, u: U, v: V) {
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
// ok
var r = true ? t : u;
var r = true ? u : t;
// ok
var r2 = true ? t : v;
var r2 = true ? v : t;
// ok
var r3 = true ? v : u;
var r3 = true ? u : v;
}