File: circularIndexedAccessErrors.symbols

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 (94 lines) | stat: -rw-r--r-- 3,282 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
=== tests/cases/conformance/types/keyof/circularIndexedAccessErrors.ts ===
type T1 = {
>T1 : Symbol(T1, Decl(circularIndexedAccessErrors.ts, 0, 0))

    x: T1["x"];  // Error
>x : Symbol(x, Decl(circularIndexedAccessErrors.ts, 0, 11))
>T1 : Symbol(T1, Decl(circularIndexedAccessErrors.ts, 0, 0))

};

type T2<K extends "x" | "y"> = {
>T2 : Symbol(T2, Decl(circularIndexedAccessErrors.ts, 2, 2))
>K : Symbol(K, Decl(circularIndexedAccessErrors.ts, 4, 8))

    x: T2<K>[K];  // Error
>x : Symbol(x, Decl(circularIndexedAccessErrors.ts, 4, 32))
>T2 : Symbol(T2, Decl(circularIndexedAccessErrors.ts, 2, 2))
>K : Symbol(K, Decl(circularIndexedAccessErrors.ts, 4, 8))
>K : Symbol(K, Decl(circularIndexedAccessErrors.ts, 4, 8))

    y: number;
>y : Symbol(y, Decl(circularIndexedAccessErrors.ts, 5, 16))
}

declare let x2: T2<"x">;
>x2 : Symbol(x2, Decl(circularIndexedAccessErrors.ts, 9, 11))
>T2 : Symbol(T2, Decl(circularIndexedAccessErrors.ts, 2, 2))

let x2x = x2.x;
>x2x : Symbol(x2x, Decl(circularIndexedAccessErrors.ts, 10, 3))
>x2.x : Symbol(x, Decl(circularIndexedAccessErrors.ts, 4, 32))
>x2 : Symbol(x2, Decl(circularIndexedAccessErrors.ts, 9, 11))
>x : Symbol(x, Decl(circularIndexedAccessErrors.ts, 4, 32))

interface T3<T extends T3<T>> {
>T3 : Symbol(T3, Decl(circularIndexedAccessErrors.ts, 10, 15))
>T : Symbol(T, Decl(circularIndexedAccessErrors.ts, 12, 13))
>T3 : Symbol(T3, Decl(circularIndexedAccessErrors.ts, 10, 15))
>T : Symbol(T, Decl(circularIndexedAccessErrors.ts, 12, 13))

    x: T["x"];
>x : Symbol(T3.x, Decl(circularIndexedAccessErrors.ts, 12, 31))
>T : Symbol(T, Decl(circularIndexedAccessErrors.ts, 12, 13))
}

interface T4<T extends T4<T>> {
>T4 : Symbol(T4, Decl(circularIndexedAccessErrors.ts, 14, 1))
>T : Symbol(T, Decl(circularIndexedAccessErrors.ts, 16, 13))
>T4 : Symbol(T4, Decl(circularIndexedAccessErrors.ts, 14, 1))
>T : Symbol(T, Decl(circularIndexedAccessErrors.ts, 16, 13))

    x: T4<T>["x"];  // Error
>x : Symbol(T4.x, Decl(circularIndexedAccessErrors.ts, 16, 31))
>T4 : Symbol(T4, Decl(circularIndexedAccessErrors.ts, 14, 1))
>T : Symbol(T, Decl(circularIndexedAccessErrors.ts, 16, 13))
}

class C1 {
>C1 : Symbol(C1, Decl(circularIndexedAccessErrors.ts, 18, 1))

    x: C1["x"];  // Error
>x : Symbol(C1.x, Decl(circularIndexedAccessErrors.ts, 20, 10))
>C1 : Symbol(C1, Decl(circularIndexedAccessErrors.ts, 18, 1))
}

class C2 {
>C2 : Symbol(C2, Decl(circularIndexedAccessErrors.ts, 22, 1))

    x: this["y"];
>x : Symbol(C2.x, Decl(circularIndexedAccessErrors.ts, 24, 10))

    y: this["z"];
>y : Symbol(C2.y, Decl(circularIndexedAccessErrors.ts, 25, 17))

    z: this["x"];
>z : Symbol(C2.z, Decl(circularIndexedAccessErrors.ts, 26, 17))
}

// Repro from #12627

interface Foo {
>Foo : Symbol(Foo, Decl(circularIndexedAccessErrors.ts, 28, 1))

    hello: boolean;
>hello : Symbol(Foo.hello, Decl(circularIndexedAccessErrors.ts, 32, 15))
}

function foo<T extends Foo | T["hello"]>() {
>foo : Symbol(foo, Decl(circularIndexedAccessErrors.ts, 34, 1))
>T : Symbol(T, Decl(circularIndexedAccessErrors.ts, 36, 13))
>Foo : Symbol(Foo, Decl(circularIndexedAccessErrors.ts, 28, 1))
>T : Symbol(T, Decl(circularIndexedAccessErrors.ts, 36, 13))
}