45 lines
No EOL
2.8 KiB
Text
45 lines
No EOL
2.8 KiB
Text
tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts(5,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts(8,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts(10,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts(13,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts(21,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts(21,28): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
|
|
|
|
==== tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts (6 errors) ====
|
|
// used to be valid, now an error to do this
|
|
|
|
interface IComparable<T> {
|
|
}
|
|
function f<T, I extends IComparable<T>>() {
|
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
}
|
|
|
|
interface I1<T, U extends I1<T, any>> { // Error, any does not satisfy the constraint I1<T, any>
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
}
|
|
interface I2<T, U extends T> {
|
|
~~~~~~~~~~~
|
|
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
}
|
|
|
|
interface I4<T, U extends () => T> {
|
|
~~~~~~~~~~~~~~~~~
|
|
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
}
|
|
|
|
// No error
|
|
interface I3<T, U extends string> {
|
|
method1<X, Y extends T>();
|
|
}
|
|
|
|
function foo<T, U extends <V extends T>(v: V) => void>() {
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
~~~~~~~~~~~
|
|
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
}
|
|
|
|
|