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

15 lines
925 B
Plaintext
Raw Normal View History

tests/cases/compiler/primitiveConstraints1.ts(1,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/compiler/primitiveConstraints1.ts(4,18): 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
==== tests/cases/compiler/primitiveConstraints1.ts (2 errors) ====
function foo1<T extends U, U>(t: T, u: U) { }
~~~~~~~~~~~
!!! 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
foo1<string, number>('hm', 1); // no error
function foo2<T, U extends T>(t: T, u: U) { }
~~~~~~~~~~~
!!! 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
foo2<number, string>(1, 'hm'); // error