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

14 lines
705 B
Plaintext
Raw Normal View History

tests/cases/compiler/typeParameterHasSelfAsConstraint.ts(1,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
2014-11-05 21:26:03 +01:00
tests/cases/compiler/typeParameterHasSelfAsConstraint.ts(2,12): error TS2322: Type 'T' is not assignable to type 'number'.
2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/typeParameterHasSelfAsConstraint.ts (2 errors) ====
function foo<T extends T>(x: T): number {
~~~~~~~~~~~
!!! 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
return x;
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'T' is not assignable to type 'number'.
2014-07-13 01:04:16 +02:00
}