TypeScript/tests/baselines/reference/primitiveConstraints1.errors.txt
2014-07-12 17:30:19 -07:00

11 lines
553 B
Plaintext

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