forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcircularRefFromClassMember.types
More file actions
87 lines (76 loc) · 1.42 KB
/
circularRefFromClassMember.types
File metadata and controls
87 lines (76 loc) · 1.42 KB
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
//// [tests/cases/compiler/circularRefFromClassMember.ts] ////
=== circularRefFromClassMember.ts ===
// Test for #61606
const result: boolean[] = [];
>result : boolean[]
> : ^^^^^^^^^
>[] : undefined[]
> : ^^^^^^^^^^^
class Test {
>Test : Test
> : ^^^^
n: 42 | "" = 42 as any;
>n : "" | 42
> : ^^^^^^^
>42 as any : any
>42 : 42
> : ^^
foo(): void {
>foo : () => void
> : ^^^^^^
if (this.n === "") {
>this.n === "" : boolean
> : ^^^^^^^
>this.n : "" | 42
> : ^^^^^^^
>this : this
> : ^^^^
>n : "" | 42
> : ^^^^^^^
>"" : ""
> : ^^
return;
}
for (let i = 0; i < 1; i++) {
>i : number
> : ^^^^^^
>0 : 0
> : ^
>i < 1 : boolean
> : ^^^^^^^
>i : number
> : ^^^^^^
>1 : 1
> : ^
>i++ : number
> : ^^^^^^
>i : number
> : ^^^^^^
const localN = this.n;
>localN : 42
> : ^^
>this.n : 42
> : ^^
>this : this
> : ^^^^
>n : 42
> : ^^
const localN_alias = localN;
>localN_alias : 42
> : ^^
>localN : 42
> : ^^
result[localN_alias] = true;
>result[localN_alias] = true : true
> : ^^^^
>result[localN_alias] : boolean
> : ^^^^^^^
>result : boolean[]
> : ^^^^^^^^^
>localN_alias : 42
> : ^^
>true : true
> : ^^^^
}
}
}