Better error recover when there is an unterminated expression before a declaration.

This commit is contained in:
Cyrus Najmabadi
2014-11-30 22:28:17 -08:00
parent db2bf0a309
commit ebe8711a21
3 changed files with 44 additions and 45 deletions

View File

@@ -1,4 +1,4 @@
tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(4,29): error TS1003: Identifier expected.
tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(5,1): error TS1003: Identifier expected.
tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(4,9): error TS2304: Cannot find name 'IgnoreRulesSpecific'.
@@ -7,9 +7,9 @@ tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(4,9): error TS2304: Ca
IgnoreRulesSpecific = 0,
}
var x = IgnoreRulesSpecific.
!!! error TS1003: Identifier expected.
~~~~~~~~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'IgnoreRulesSpecific'.
var y = Position.IgnoreRulesSpecific;
!!! error TS1003: Identifier expected.

View File

@@ -1,4 +1,4 @@
tests/cases/compiler/enumMemberResolution.ts(4,29): error TS1003: Identifier expected.
tests/cases/compiler/enumMemberResolution.ts(5,1): error TS1003: Identifier expected.
tests/cases/compiler/enumMemberResolution.ts(4,9): error TS2304: Cannot find name 'IgnoreRulesSpecific'.
@@ -7,10 +7,10 @@ tests/cases/compiler/enumMemberResolution.ts(4,9): error TS2304: Cannot find nam
IgnoreRulesSpecific = 0
}
var x = IgnoreRulesSpecific. // error
!!! error TS1003: Identifier expected.
~~~~~~~~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'IgnoreRulesSpecific'.
var y = 1;
!!! error TS1003: Identifier expected.
var z = Position2.IgnoreRulesSpecific; // no error