File: objectTypesIdentityWithComplexConstraints.types

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (31 lines) | stat: -rw-r--r-- 724 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithComplexConstraints.ts ===
interface A {
      <T extends {
            <S extends A>(x: T, y: S): void
>x : T
>y : S

      }>(x: T, y: T): void
>x : T
>y : T
}

interface B {
      <U extends B>(x: U, y: U): void
>x : U
>y : U
}

// ok, not considered identical because the steps of contextual signature instantiation create fresh type parameters
function foo(x: A);
>foo : { (x: A): any; (x: B): any; }
>x : A

function foo(x: B); // error after constraints above made illegal
>foo : { (x: A): any; (x: B): any; }
>x : B

function foo(x: any) { }
>foo : { (x: A): any; (x: B): any; }
>x : any