1
+ disallowedBlockScopedInPresenceOfParseErrors1.ts(5,5): error TS1156: 'const' declarations can only be declared inside a block.
1
2
disallowedBlockScopedInPresenceOfParseErrors1.ts(6,17): error TS2454: Variable 'e' is used before being assigned.
2
3
disallowedBlockScopedInPresenceOfParseErrors1.ts(8,1): error TS1128: Declaration or statement expected.
4
+ disallowedBlockScopedInPresenceOfParseErrors1.ts(12,5): error TS1156: 'let' declarations can only be declared inside a block.
3
5
disallowedBlockScopedInPresenceOfParseErrors1.ts(13,17): error TS2454: Variable 'e' is used before being assigned.
4
6
disallowedBlockScopedInPresenceOfParseErrors1.ts(15,1): error TS1128: Declaration or statement expected.
7
+ disallowedBlockScopedInPresenceOfParseErrors1.ts(21,5): error TS1156: 'using' declarations can only be declared inside a block.
5
8
disallowedBlockScopedInPresenceOfParseErrors1.ts(22,17): error TS2454: Variable 'e' is used before being assigned.
6
9
disallowedBlockScopedInPresenceOfParseErrors1.ts(24,1): error TS1128: Declaration or statement expected.
10
+ disallowedBlockScopedInPresenceOfParseErrors1.ts(30,5): error TS1156: 'await using' declarations can only be declared inside a block.
7
11
disallowedBlockScopedInPresenceOfParseErrors1.ts(31,17): error TS2454: Variable 'e' is used before being assigned.
8
12
disallowedBlockScopedInPresenceOfParseErrors1.ts(33,1): error TS1128: Declaration or statement expected.
9
13
10
14
11
- ==== disallowedBlockScopedInPresenceOfParseErrors1.ts (8 errors) ====
15
+ ==== disallowedBlockScopedInPresenceOfParseErrors1.ts (12 errors) ====
12
16
// https://github.com/microsoft/TypeScript/issues/61734
13
17
14
18
function f1() {
15
19
if (1 > 0)
16
20
const e = 3;
21
+ ~~~~~~~~~~~~
22
+ !!! error TS1156: 'const' declarations can only be declared inside a block.
17
23
console.log(e);
18
24
~
19
25
!!! error TS2454: Variable 'e' is used before being assigned.
@@ -25,6 +31,8 @@ disallowedBlockScopedInPresenceOfParseErrors1.ts(33,1): error TS1128: Declaratio
25
31
function f2() {
26
32
if (1 > 0)
27
33
let e = 3;
34
+ ~~~~~~~~~~
35
+ !!! error TS1156: 'let' declarations can only be declared inside a block.
28
36
console.log(e);
29
37
~
30
38
!!! error TS2454: Variable 'e' is used before being assigned.
@@ -38,6 +46,8 @@ disallowedBlockScopedInPresenceOfParseErrors1.ts(33,1): error TS1128: Declaratio
38
46
function f3() {
39
47
if (1 > 0)
40
48
using e = resource;
49
+ ~~~~~~~~~~~~~~~~~~~
50
+ !!! error TS1156: 'using' declarations can only be declared inside a block.
41
51
console.log(e);
42
52
~
43
53
!!! error TS2454: Variable 'e' is used before being assigned.
@@ -51,6 +61,8 @@ disallowedBlockScopedInPresenceOfParseErrors1.ts(33,1): error TS1128: Declaratio
51
61
async function f4() {
52
62
if (1 > 0)
53
63
await using e = asyncResource;
64
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
65
+ !!! error TS1156: 'await using' declarations can only be declared inside a block.
54
66
console.log(e);
55
67
~
56
68
!!! error TS2454: Variable 'e' is used before being assigned.
0 commit comments