File: circularBaseTypes.symbols

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (46 lines) | stat: -rw-r--r-- 1,554 bytes parent folder | download
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
=== tests/cases/compiler/circularBaseTypes.ts ===
// Repro from #38098

type M<T> = { value: T };
>M : Symbol(M, Decl(circularBaseTypes.ts, 0, 0))
>T : Symbol(T, Decl(circularBaseTypes.ts, 2, 7))
>value : Symbol(value, Decl(circularBaseTypes.ts, 2, 13))
>T : Symbol(T, Decl(circularBaseTypes.ts, 2, 7))

interface M2 extends M<M3> {};  // Error
>M2 : Symbol(M2, Decl(circularBaseTypes.ts, 2, 25))
>M : Symbol(M, Decl(circularBaseTypes.ts, 0, 0))
>M3 : Symbol(M3, Decl(circularBaseTypes.ts, 3, 30))

type M3 = M2[keyof M2];  // Error
>M3 : Symbol(M3, Decl(circularBaseTypes.ts, 3, 30))
>M2 : Symbol(M2, Decl(circularBaseTypes.ts, 2, 25))
>M2 : Symbol(M2, Decl(circularBaseTypes.ts, 2, 25))

function f(m: M3) {
>f : Symbol(f, Decl(circularBaseTypes.ts, 4, 23))
>m : Symbol(m, Decl(circularBaseTypes.ts, 6, 11))
>M3 : Symbol(M3, Decl(circularBaseTypes.ts, 3, 30))

  return m.value;
>m : Symbol(m, Decl(circularBaseTypes.ts, 6, 11))
}

// Repro from #32581

type X<T> = { [K in keyof T]: string } & { b: string };
>X : Symbol(X, Decl(circularBaseTypes.ts, 8, 1))
>T : Symbol(T, Decl(circularBaseTypes.ts, 12, 7))
>K : Symbol(K, Decl(circularBaseTypes.ts, 12, 15))
>T : Symbol(T, Decl(circularBaseTypes.ts, 12, 7))
>b : Symbol(b, Decl(circularBaseTypes.ts, 12, 42))

interface Y extends X<Y> {
>Y : Symbol(Y, Decl(circularBaseTypes.ts, 12, 55))
>X : Symbol(X, Decl(circularBaseTypes.ts, 8, 1))
>Y : Symbol(Y, Decl(circularBaseTypes.ts, 12, 55))

  a: "";
>a : Symbol(Y.a, Decl(circularBaseTypes.ts, 13, 26))
}