49 lines
No EOL
1.6 KiB
Text
49 lines
No EOL
1.6 KiB
Text
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(3,13): error TS1005: '(' expected.
|
|
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(6,5): error TS1005: 'try' expected.
|
|
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(12,5): error TS1005: 'try' expected.
|
|
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(13,5): error TS1005: 'try' expected.
|
|
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(22,5): error TS1005: 'try' expected.
|
|
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(26,5): error TS1005: 'try' expected.
|
|
|
|
|
|
==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (6 errors) ====
|
|
function fn() {
|
|
try {
|
|
} catch { // syntax error, missing '(x)'
|
|
~
|
|
!!! error TS1005: '(' expected.
|
|
}
|
|
|
|
catch(x) { } // error missing try
|
|
~~~~~
|
|
!!! error TS1005: 'try' expected.
|
|
|
|
finally{ } // potential error; can be absorbed by the 'catch'
|
|
}
|
|
|
|
function fn2() {
|
|
finally { } // error missing try
|
|
~~~~~~~
|
|
!!! error TS1005: 'try' expected.
|
|
catch (x) { } // error missing try
|
|
~~~~~
|
|
!!! error TS1005: 'try' expected.
|
|
|
|
// no error
|
|
try {
|
|
}
|
|
finally {
|
|
}
|
|
|
|
// error missing try
|
|
finally {
|
|
~~~~~~~
|
|
!!! error TS1005: 'try' expected.
|
|
}
|
|
|
|
// error missing try
|
|
catch (x) {
|
|
~~~~~
|
|
!!! error TS1005: 'try' expected.
|
|
}
|
|
} |