Resolve parsingContextErrors TODO (#50011)

* Add a test with broken code

* Resolve TODO
This commit is contained in:
Jake Bailey
2022-07-26 08:59:06 -07:00
committed by GitHub
parent bcd22b47d2
commit 3afe2d654e
7 changed files with 280 additions and 1 deletions

View File

@@ -1497,6 +1497,10 @@
"category": "Error",
"code": 1477
},
"Identifier or string literal expected.": {
"category": "Error",
"code": 1478
},
"The types of '{0}' are incompatible between these types.": {
"category": "Error",

View File

@@ -2780,7 +2780,9 @@ namespace ts {
case ParsingContext.ImportOrExportSpecifiers: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
case ParsingContext.JsxAttributes: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
case ParsingContext.JsxChildren: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
default: return [undefined!]; // TODO: GH#18217 `default: Debug.assertNever(context);`
case ParsingContext.AssertEntries: return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected); // AssertionKey.
case ParsingContext.Count: return Debug.fail("ParsingContext.Count used as a context"); // Not a real context, only a marker.
default: Debug.assertNever(context);
}
}