11tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(2,5): error TS1005: 'try' expected.
2- tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(8,5): error TS1005: 'try' expected.
3- tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(9,5): error TS1005: 'try' expected.
4- tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(18,5): error TS1005: 'try' expected.
5- tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(22,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.
68
79
8- ==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (5 errors) ====
10+ ==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (7 errors) ====
911 function fn() {
1012 catch(x) { } // error missing try
1113 ~~~~~
1214!!! error TS1005: 'try' expected.
1315
14- finally{ } // potential error; can be absorbed by the 'catch'
16+ finally { } // potential error; can be absorbed by the 'catch'
17+
18+ try { }; // missing finally
19+ ~
20+ !!! error TS1005: 'finally' expected.
1521 }
1622
1723 function fn2() {
@@ -21,22 +27,18 @@ tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(22,5):
2127 catch (x) { } // error missing try
2228 ~~~~~
2329!!! 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
2432
25- // no error
26- try {
27- }
28- finally {
29- }
30-
31- // error missing try
32- finally {
33+ finally { } // error missing try
3334 ~~~~~~~
3435!!! error TS1005: 'try' expected.
35- }
36-
37- // error missing try
38- catch (x) {
36+
37+ catch (x) { } // error missing try
3938 ~~~~~
4039!!! error TS1005: 'try' expected.
41- }
40+
41+ try { } catch () { } // error missing catch binding
42+ ~
43+ !!! error TS1003: Identifier expected.
4244 }
0 commit comments