1
- tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(3,13): error TS1005: '(' expected.
2
- tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(6,5): error TS1005: 'try' expected.
3
- tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(12,5): error TS1005: 'try' expected.
4
- tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(13,5): error TS1005: 'try' expected.
5
- tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(22,5): error TS1005: 'try' expected.
6
- tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(26,5): error TS1005: 'try' expected.
1
+ tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(2,5): error TS1005: 'try' expected.
2
+ tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(6,12): error TS1005: 'finally' expected.
3
+ tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(10,5): error TS1005: 'try' expected.
4
+ tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(11,5): error TS1005: 'try' expected.
5
+ tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(15,5): error TS1005: 'try' expected.
6
+ tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(17,5): error TS1005: 'try' expected.
7
+ tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(19,20): error TS1003: Identifier expected.
7
8
8
9
9
- ==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (6 errors) ====
10
+ ==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (7 errors) ====
10
11
function fn() {
11
- try {
12
- } catch { // syntax error, missing '(x)'
13
- ~
14
- !!! error TS1005: '(' expected.
15
- }
16
-
17
12
catch(x) { } // error missing try
18
13
~~~~~
19
14
!!! error TS1005: 'try' expected.
20
15
21
- finally{ } // potential error; can be absorbed by the 'catch'
16
+ finally { } // potential error; can be absorbed by the 'catch'
17
+
18
+ try { }; // error missing finally
19
+ ~
20
+ !!! error TS1005: 'finally' expected.
22
21
}
23
22
24
23
function fn2() {
@@ -28,22 +27,18 @@ tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(26,5):
28
27
catch (x) { } // error missing try
29
28
~~~~~
30
29
!!! error TS1005: 'try' expected.
30
+
31
+ try { } finally { } // statement is here, so the 'catch' clause above doesn't absorb errors from the 'finally' clause below
31
32
32
- // no error
33
- try {
34
- }
35
- finally {
36
- }
37
-
38
- // error missing try
39
- finally {
33
+ finally { } // error missing try
40
34
~~~~~~~
41
35
!!! error TS1005: 'try' expected.
42
- }
43
-
44
- // error missing try
45
- catch (x) {
36
+
37
+ catch (x) { } // error missing try
46
38
~~~~~
47
39
!!! error TS1005: 'try' expected.
48
- }
40
+
41
+ try { } catch () { } // error missing catch binding
42
+ ~
43
+ !!! error TS1003: Identifier expected.
49
44
}
0 commit comments