In addition, allow an explicit `any`; anything else throws an error. Also adjust and reorganize existing tests. Fixes #36775.
44 lines
1.8 KiB
Plaintext
44 lines
1.8 KiB
Plaintext
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(2,5): error TS1005: 'try' expected.
|
|
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(6,12): error TS1005: 'finally' expected.
|
|
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(10,5): error TS1005: 'try' expected.
|
|
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(11,5): error TS1005: 'try' expected.
|
|
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(15,5): error TS1005: 'try' expected.
|
|
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(17,5): error TS1005: 'try' expected.
|
|
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(19,20): error TS1003: Identifier expected.
|
|
|
|
|
|
==== tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts (7 errors) ====
|
|
function fn() {
|
|
catch(x) { } // error missing try
|
|
~~~~~
|
|
!!! error TS1005: 'try' expected.
|
|
|
|
finally { } // potential error; can be absorbed by the 'catch'
|
|
|
|
try { }; // error missing finally
|
|
~
|
|
!!! error TS1005: 'finally' expected.
|
|
}
|
|
|
|
function fn2() {
|
|
finally { } // error missing try
|
|
~~~~~~~
|
|
!!! error TS1005: 'try' expected.
|
|
catch (x) { } // error missing try
|
|
~~~~~
|
|
!!! error TS1005: 'try' expected.
|
|
|
|
try { } finally { } // statement is here, so the 'catch' clause above doesn't absorb errors from the 'finally' clause below
|
|
|
|
finally { } // error missing try
|
|
~~~~~~~
|
|
!!! error TS1005: 'try' expected.
|
|
|
|
catch (x) { } // error missing try
|
|
~~~~~
|
|
!!! error TS1005: 'try' expected.
|
|
|
|
try { } catch () { } // error missing catch binding
|
|
~
|
|
!!! error TS1003: Identifier expected.
|
|
} |