10 lines
No EOL
368 B
Text
10 lines
No EOL
368 B
Text
==== 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'.
|
|
}
|
|
|
|
|