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

10 lines
368 B
Plaintext
Raw Normal View History

2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/typeParameterHasSelfAsConstraint.ts (2 errors) ====
function foo<T extends T>(x: T): number {
~~~~~~~~~~~
!!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
return x;
~
!!! Type 'T' is not assignable to type 'number'.
}