File: objectTypesIdentityWithComplexConstraints.js

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 (18 lines) | stat: -rw-r--r-- 520 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//// [objectTypesIdentityWithComplexConstraints.ts]
interface A {
      <T extends {
            <S extends A>(x: T, y: S): void
      }>(x: T, y: T): void
}

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) { }

//// [objectTypesIdentityWithComplexConstraints.js]
function foo(x) { }