Fix unexpected TS1005 in tryParseSignature (#149)

This commit is contained in:
Max Graey 2018-06-24 02:06:31 +03:00 committed by Daniel Wirtz
parent 188b4e48ce
commit 2e5a42d233
3 changed files with 11 additions and 4 deletions

View File

@ -650,10 +650,14 @@ export class Parser extends DiagnosticEmitter {
}
} while (tn.skip(Token.COMMA));
if (!tn.skip(Token.CLOSEPAREN)) {
if (isSignature) {
this.error(
DiagnosticCode._0_expected,
tn.range(), ")"
);
} else {
tn.reset(state);
}
this.tryParseSignatureIsSignature = isSignature;
return null;
}

View File

@ -8,3 +8,5 @@ var e;
// 1155: 'const' declarations must be initialized.
const f: i32;
const t = 0 < (c / 10);

View File

@ -4,5 +4,6 @@ const c: i32 = 0;
var d = 2;
var e;
const f: i32;
const t = 0 < (c / 10);
// ERROR 1110: "Type expected." in var.ts:7:5
// ERROR 1155: "'const' declarations must be initialized." in var.ts:10:6