2015-02-03 00:15:54 +01:00
|
|
|
//// [invalidTryStatements.ts]
|
|
|
|
function fn() {
|
|
|
|
try {
|
|
|
|
} catch (x) {
|
|
|
|
var x: string; // ensure x is 'Any'
|
|
|
|
}
|
|
|
|
|
|
|
|
// no type annotation allowed
|
|
|
|
try { } catch (z: any) { }
|
|
|
|
try { } catch (a: number) { }
|
|
|
|
try { } catch (y: string) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//// [invalidTryStatements.js]
|
|
|
|
function fn() {
|
|
|
|
try {
|
|
|
|
}
|
|
|
|
catch (x) {
|
|
|
|
var x; // ensure x is 'Any'
|
|
|
|
}
|
|
|
|
// no type annotation allowed
|
2015-03-26 21:46:35 +01:00
|
|
|
try { }
|
|
|
|
catch (z) { }
|
|
|
|
try { }
|
|
|
|
catch (a) { }
|
|
|
|
try { }
|
|
|
|
catch (y) { }
|
2015-02-03 00:15:54 +01:00
|
|
|
}
|