22 lines
1 KiB
Plaintext
22 lines
1 KiB
Plaintext
tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithComplexConstraints.ts(2,8): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
|
|
|
|
==== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithComplexConstraints.ts (1 errors) ====
|
|
interface A {
|
|
<T extends {
|
|
~~~~~~~~~~~
|
|
<S extends A>(x: T, y: S): void
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
}>(x: T, y: T): void
|
|
~~~~~~~
|
|
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
|
|
}
|
|
|
|
interface B {
|
|
<U extends B>(x: U, y: U): void
|
|
}
|
|
|
|
// ok, not considered identical because the steps of contextual signature instantiation create fresh type parameters
|
|
function foo(x: A);
|
|
function foo(x: B); // error after constraints above made illegal
|
|
function foo(x: any) { } |