File: letDeclarations-scopes.errors.txt

package info (click to toggle)
node-typescript 4.9.5%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 533,908 kB
  • sloc: javascript: 2,018,330; makefile: 7; sh: 1
file content (162 lines) | stat: -rw-r--r-- 2,797 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
tests/cases/compiler/letDeclarations-scopes.ts(27,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.


==== tests/cases/compiler/letDeclarations-scopes.ts (1 errors) ====
    // global
    let l = "string";
    
    var n: number;
    
    // Control flow statements with blocks
    if (true) {
        let l = 0;
        n = l;
    }
    else {
        let l = 0;
        n = l;
    }
    
    while (true) {
        let l = 0;
        n = l;
    }
    
    do {
       let l = 0;
        n = l;
    } while (true);
    
    var obj;
    with (obj) {
    ~~~~~~~~~~
!!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'.
        let l = 0;
        n = l;
    }
    
    for (var i = 0; i < 10; i++) {
        let l = 0;
        n = l;
    }
    
    for (var i2 in {}) {
        let l = 0;
        n = l;
    }
    
    if (true) {
        label: let l = 0;
        n = l;
    }
    
    while (false) {
        label2: label3: label4: let l = 0;
        n = l;
    }
    
    for (let l = 0; n = l; l++) {
        let l = true;
        var b3: boolean = l;
    }
    
    for (let l in {}) {
    
    }
    
    // Try/catch/finally
    try {
        let l = 0;
        n = l;
    }
    catch (e) {
        let l = 0;
        n = l;
    }
    finally {
        let l = 0;
        n = l;
    }
    
    // Switch
    switch (0) {
        case 0:
            let l = 0;
            n = l;
            break;
    }
    
    // blocks
    {
        let l = 0;
        n = l;
        {
            let l = false;
            var b: boolean = l;
        }
    }
    
    // functions
    function F() {
        let l = 0;
        n = l;
    }
    
    var F2 = () => {
        let l = 0;
        n = l;
    };
    
    var F3 = function () {
        let l = 0;
        n = l;
    };
    
    // modules
    module m {
        let l = 0;
        n = l;
    
        {
           let l = false;
           var b2: boolean = l;
        }
    
        lable: let l2 = 0;
    }
    
    // methods
    class C {
        constructor() {
            let l = 0;
            n = l;
        }
    
        method() {
            let l = 0;
            n = l;
        }
    
        get v() {
            let l = 0;
            n = l;
            return n;
        }
    
        set v(value) {
            let l = 0;
            n = l;
        }
    }
    
    // object literals
    var o = {
        f() {
            let l = 0;
            n = l;
        },
        f2: () => {
            let l = 0;
            n = l;
        }
    }