Specific diagnostic suggestions for unexpected keyword or identifier (#43005)

Error message improvement for unexpected tokens in the following situations:

* A word was parsed that seems to have a low edit distance from a known common keyword
* A word was parsed that seems to be a known common keyword and a name _without_ a space in-between
* Parsing in a particular type of node (mostly a class property declaration) got a different word or token than expected

___

* Specific diagnostic suggestions for unexpected keywords or identifier

* Don't reach into there, that's not allowed

* Improved error when there is already an initializer

* Specific module error message for invalid template literal strings

* Skip 'unexpected keyword or identifier' diagnostics for declare nodes

* Improve error for function calls in type positions

* Switch class properties to old diagnostic

* Corrected errors in class members and reused existing textToKeywordObj map

* Corrected more baselines from the merge

* Update src/compiler/parser.ts

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>

* Mostly addressed feedback

* Clarified function call type message

* Split up and clarified parsing vs error functions

* Swap interface name complaints back, and skip new errors on unknown (invalid) tokens

* Used tokenToString, not a raw semicolon

* Inline getExpressionText helper

* Remove remarks in src/compiler/parser.ts

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
This commit is contained in:
Josh Goldberg
2021-07-14 16:50:55 -04:00
committed by GitHub
parent 3358f137c6
commit 541e553163
46 changed files with 1054 additions and 304 deletions
+44
View File
@@ -1368,6 +1368,46 @@
"category": "Error",
"code": 1433
},
"Unexpected keyword or identifier.": {
"category": "Error",
"code": 1434
},
"Unknown keyword or identifier. Did you mean '{0}'?": {
"category": "Error",
"code": 1435
},
"Decorators must precede the name and all keywords of property declarations.": {
"category": "Error",
"code": 1436
},
"Namespace must be given a name.": {
"category": "Error",
"code": 1437
},
"Interface must be given a name.": {
"category": "Error",
"code": 1438
},
"Type alias must be given a name.": {
"category": "Error",
"code": 1439
},
"Variable declaration not allowed at this location.": {
"category": "Error",
"code": 1440
},
"Cannot start a function call in a type annotation.": {
"category": "Error",
"code": 1441
},
"Missing '=' before default property value.": {
"category": "Error",
"code": 1442
},
"Module declaration names may only use ' or \" quoted strings.": {
"category": "Error",
"code": 1443
},
"The types of '{0}' are incompatible between these types.": {
"category": "Error",
@@ -3356,6 +3396,10 @@
"category": "Error",
"code": 2818
},
"Namespace name cannot be '{0}'.": {
"category": "Error",
"code": 2819
},
"Import declaration '{0}' is using private name '{1}'.": {
"category": "Error",
+163 -13
View File
@@ -1549,6 +1549,149 @@ namespace ts {
return false;
}
const viableKeywordSuggestions = Object.keys(textToKeywordObj).filter(keyword => keyword.length > 2);
/**
* Provides a better error message than the generic "';' expected" if possible for
* known common variants of a missing semicolon, such as from a mispelled names.
*
* @param node Node preceding the expected semicolon location.
*/
function parseErrorForMissingSemicolonAfter(node: Expression | PropertyName): void {
// Tagged template literals are sometimes used in places where only simple strings are allowed, i.e.:
// module `M1` {
// ^^^^^^^^^^^ This block is parsed as a template literal like module`M1`.
if (isTaggedTemplateExpression(node)) {
parseErrorAt(skipTrivia(sourceText, node.template.pos), node.template.end, Diagnostics.Module_declaration_names_may_only_use_or_quoted_strings);
return;
}
// Otherwise, if this isn't a well-known keyword-like identifier, give the generic fallback message.
const expressionText = ts.isIdentifier(node) ? idText(node) : undefined;
if (!expressionText || !isIdentifierText(expressionText, languageVersion)) {
parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(SyntaxKind.SemicolonToken));
return;
}
const pos = skipTrivia(sourceText, node.pos);
// Some known keywords are likely signs of syntax being used improperly.
switch (expressionText) {
case "const":
case "let":
case "var":
parseErrorAt(pos, node.end, Diagnostics.Variable_declaration_not_allowed_at_this_location);
return;
case "declare":
// If a declared node failed to parse, it would have emitted a diagnostic already.
return;
case "interface":
parseErrorForInvalidName(Diagnostics.Interface_name_cannot_be_0, Diagnostics.Interface_must_be_given_a_name, SyntaxKind.OpenBraceToken);
return;
case "is":
parseErrorAt(pos, scanner.getTextPos(), Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);
return;
case "module":
case "namespace":
parseErrorForInvalidName(Diagnostics.Namespace_name_cannot_be_0, Diagnostics.Namespace_must_be_given_a_name, SyntaxKind.OpenBraceToken);
return;
case "type":
parseErrorForInvalidName(Diagnostics.Type_alias_name_cannot_be_0, Diagnostics.Type_alias_must_be_given_a_name, SyntaxKind.EqualsToken);
return;
}
// The user alternatively might have misspelled or forgotten to add a space after a common keyword.
const suggestion = getSpellingSuggestion(expressionText, viableKeywordSuggestions, n => n) ?? getSpaceSuggestion(expressionText);
if (suggestion) {
parseErrorAt(pos, node.end, Diagnostics.Unknown_keyword_or_identifier_Did_you_mean_0, suggestion);
return;
}
// Unknown tokens are handled with their own errors in the scanner
if (token() === SyntaxKind.Unknown) {
return;
}
// Otherwise, we know this some kind of unknown word, not just a missing expected semicolon.
parseErrorAt(pos, node.end, Diagnostics.Unexpected_keyword_or_identifier);
}
/**
* Reports a diagnostic error for the current token being an invalid name.
*
* @param blankDiagnostic Diagnostic to report for the case of the name being blank (matched tokenIfBlankName).
* @param nameDiagnostic Diagnostic to report for all other cases.
* @param tokenIfBlankName Current token if the name was invalid for being blank (not provided / skipped).
*/
function parseErrorForInvalidName(nameDiagnostic: DiagnosticMessage, blankDiagnostic: DiagnosticMessage, tokenIfBlankName: SyntaxKind) {
if (token() === tokenIfBlankName) {
parseErrorAtCurrentToken(blankDiagnostic);
}
else {
parseErrorAtCurrentToken(nameDiagnostic, tokenToString(token()));
}
}
function getSpaceSuggestion(expressionText: string) {
for (const keyword of viableKeywordSuggestions) {
if (expressionText.length > keyword.length + 2 && startsWith(expressionText, keyword)) {
return `${keyword} ${expressionText.slice(keyword.length)}`;
}
}
return undefined;
}
function parseSemicolonAfterPropertyName(name: PropertyName, type: TypeNode | undefined, initializer: Expression | undefined) {
switch (token()) {
case SyntaxKind.AtToken:
parseErrorAtCurrentToken(Diagnostics.Decorators_must_precede_the_name_and_all_keywords_of_property_declarations);
return;
case SyntaxKind.OpenParenToken:
parseErrorAtCurrentToken(Diagnostics.Cannot_start_a_function_call_in_a_type_annotation);
nextToken();
return;
}
if (type && !canParseSemicolon()) {
if (initializer) {
parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(SyntaxKind.SemicolonToken));
}
else {
parseErrorAtCurrentToken(Diagnostics.Missing_before_default_property_value);
}
return;
}
if (tryParseSemicolon()) {
return;
}
// If an initializer was parsed but there is still an error in finding the next semicolon,
// we generally know there was an error already reported in the initializer...
// class Example { a = new Map([), ) }
// ~
if (initializer) {
// ...unless we've found the start of a block after a property declaration, in which
// case we can know that regardless of the initializer we should complain on the block.
// class Example { a = 0 {} }
// ~
if (token() === SyntaxKind.OpenBraceToken) {
parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(SyntaxKind.SemicolonToken));
}
return;
}
parseErrorForMissingSemicolonAfter(name);
}
function parseExpectedJSDoc(kind: JSDocSyntaxKind) {
if (token() === kind) {
nextTokenJSDoc();
@@ -1618,18 +1761,21 @@ namespace ts {
return token() === SyntaxKind.CloseBraceToken || token() === SyntaxKind.EndOfFileToken || scanner.hasPrecedingLineBreak();
}
function parseSemicolon(): boolean {
if (canParseSemicolon()) {
if (token() === SyntaxKind.SemicolonToken) {
// consume the semicolon if it was explicitly provided.
nextToken();
}
function tryParseSemicolon() {
if (!canParseSemicolon()) {
return false;
}
return true;
}
else {
return parseExpected(SyntaxKind.SemicolonToken);
if (token() === SyntaxKind.SemicolonToken) {
// consume the semicolon if it was explicitly provided.
nextToken();
}
return true;
}
function parseSemicolon(): boolean {
return tryParseSemicolon() || parseExpected(SyntaxKind.SemicolonToken);
}
function createNodeArray<T extends Node>(elements: T[], pos: number, end?: number, hasTrailingComma?: boolean): NodeArray<T> {
@@ -5888,7 +6034,9 @@ namespace ts {
identifierCount++;
expression = finishNode(factory.createIdentifier(""), getNodePos());
}
parseSemicolon();
if (!tryParseSemicolon()) {
parseErrorForMissingSemicolonAfter(expression);
}
return withJSDoc(finishNode(factory.createThrowStatement(expression), pos), hasJSDoc);
}
@@ -5951,7 +6099,9 @@ namespace ts {
node = factory.createLabeledStatement(expression, parseStatement());
}
else {
parseSemicolon();
if (!tryParseSemicolon()) {
parseErrorForMissingSemicolonAfter(expression);
}
node = factory.createExpressionStatement(expression);
if (hasParen) {
// do not parse the same jsdoc twice
@@ -6546,7 +6696,7 @@ namespace ts {
const exclamationToken = !questionToken && !scanner.hasPrecedingLineBreak() ? parseOptionalToken(SyntaxKind.ExclamationToken) : undefined;
const type = parseTypeAnnotation();
const initializer = doOutsideOfContext(NodeFlags.YieldContext | NodeFlags.AwaitContext | NodeFlags.DisallowInContext, parseInitializer);
parseSemicolon();
parseSemicolonAfterPropertyName(name, type, initializer);
const node = factory.createPropertyDeclaration(decorators, modifiers, name, questionToken || exclamationToken, type, initializer);
return withJSDoc(finishNode(node, pos), hasJSDoc);
}
+2 -1
View File
@@ -77,7 +77,8 @@ namespace ts {
tryScan<T>(callback: () => T): T;
}
const textToKeywordObj: MapLike<KeywordSyntaxKind> = {
/** @internal */
export const textToKeywordObj: MapLike<KeywordSyntaxKind> = {
abstract: SyntaxKind.AbstractKeyword,
any: SyntaxKind.AnyKeyword,
as: SyntaxKind.AsKeyword,
@@ -1,4 +1,4 @@
tests/cases/compiler/ClassDeclaration26.ts(2,22): error TS1005: ';' expected.
tests/cases/compiler/ClassDeclaration26.ts(2,18): error TS1440: Variable declaration not allowed at this location.
tests/cases/compiler/ClassDeclaration26.ts(4,5): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
tests/cases/compiler/ClassDeclaration26.ts(4,20): error TS1005: ',' expected.
tests/cases/compiler/ClassDeclaration26.ts(4,23): error TS1005: '=>' expected.
@@ -8,8 +8,8 @@ tests/cases/compiler/ClassDeclaration26.ts(5,1): error TS1128: Declaration or st
==== tests/cases/compiler/ClassDeclaration26.ts (5 errors) ====
class C {
public const var export foo = 10;
~~~~~~
!!! error TS1005: ';' expected.
~~~
!!! error TS1440: Variable declaration not allowed at this location.
var constructor() { }
~~~
@@ -1,9 +1,9 @@
tests/cases/compiler/anonymousModules.ts(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
tests/cases/compiler/anonymousModules.ts(1,8): error TS1005: ';' expected.
tests/cases/compiler/anonymousModules.ts(1,8): error TS1437: Namespace must be given a name.
tests/cases/compiler/anonymousModules.ts(4,2): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
tests/cases/compiler/anonymousModules.ts(4,9): error TS1005: ';' expected.
tests/cases/compiler/anonymousModules.ts(4,9): error TS1437: Namespace must be given a name.
tests/cases/compiler/anonymousModules.ts(10,2): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
tests/cases/compiler/anonymousModules.ts(10,9): error TS1005: ';' expected.
tests/cases/compiler/anonymousModules.ts(10,9): error TS1437: Namespace must be given a name.
==== tests/cases/compiler/anonymousModules.ts (6 errors) ====
@@ -11,14 +11,14 @@ tests/cases/compiler/anonymousModules.ts(10,9): error TS1005: ';' expected.
~~~~~~
!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
~
!!! error TS1005: ';' expected.
!!! error TS1437: Namespace must be given a name.
export var foo = 1;
module {
~~~~~~
!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
~
!!! error TS1005: ';' expected.
!!! error TS1437: Namespace must be given a name.
export var bar = 1;
}
@@ -28,7 +28,7 @@ tests/cases/compiler/anonymousModules.ts(10,9): error TS1005: ';' expected.
~~~~~~
!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
~
!!! error TS1005: ';' expected.
!!! error TS1437: Namespace must be given a name.
var x = bar;
}
}
@@ -11,14 +11,16 @@ tests/cases/compiler/classUpdateTests.ts(95,1): error TS1128: Declaration or sta
tests/cases/compiler/classUpdateTests.ts(99,3): error TS1128: Declaration or statement expected.
tests/cases/compiler/classUpdateTests.ts(101,1): error TS1128: Declaration or statement expected.
tests/cases/compiler/classUpdateTests.ts(105,3): error TS1128: Declaration or statement expected.
tests/cases/compiler/classUpdateTests.ts(105,14): error TS1005: ';' expected.
tests/cases/compiler/classUpdateTests.ts(105,10): error TS1434: Unexpected keyword or identifier.
tests/cases/compiler/classUpdateTests.ts(105,14): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
tests/cases/compiler/classUpdateTests.ts(107,1): error TS1128: Declaration or statement expected.
tests/cases/compiler/classUpdateTests.ts(111,3): error TS1128: Declaration or statement expected.
tests/cases/compiler/classUpdateTests.ts(111,15): error TS1005: ';' expected.
tests/cases/compiler/classUpdateTests.ts(111,11): error TS1434: Unexpected keyword or identifier.
tests/cases/compiler/classUpdateTests.ts(111,15): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
tests/cases/compiler/classUpdateTests.ts(113,1): error TS1128: Declaration or statement expected.
==== tests/cases/compiler/classUpdateTests.ts (16 errors) ====
==== tests/cases/compiler/classUpdateTests.ts (18 errors) ====
//
// test codegen for instance properties
//
@@ -154,8 +156,10 @@ tests/cases/compiler/classUpdateTests.ts(113,1): error TS1128: Declaration or st
public this.p1 = 0; // ERROR
~~~~~~
!!! error TS1128: Declaration or statement expected.
~~~~
!!! error TS1434: Unexpected keyword or identifier.
~
!!! error TS1005: ';' expected.
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
}
}
~
@@ -166,8 +170,10 @@ tests/cases/compiler/classUpdateTests.ts(113,1): error TS1128: Declaration or st
private this.p1 = 0; // ERROR
~~~~~~~
!!! error TS1128: Declaration or statement expected.
~~~~
!!! error TS1434: Unexpected keyword or identifier.
~
!!! error TS1005: ';' expected.
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
}
}
~
@@ -0,0 +1,313 @@
tests/cases/compiler/commonMissingSemicolons.ts(2,1): error TS1435: Unknown keyword or identifier. Did you mean 'async'?
tests/cases/compiler/commonMissingSemicolons.ts(2,1): error TS2304: Cannot find name 'asynd'.
tests/cases/compiler/commonMissingSemicolons.ts(3,1): error TS1435: Unknown keyword or identifier. Did you mean 'async'?
tests/cases/compiler/commonMissingSemicolons.ts(3,1): error TS2304: Cannot find name 'sasync'.
tests/cases/compiler/commonMissingSemicolons.ts(8,23): error TS2304: Cannot find name 'asyncd'.
tests/cases/compiler/commonMissingSemicolons.ts(8,33): error TS1005: ';' expected.
tests/cases/compiler/commonMissingSemicolons.ts(11,1): error TS1435: Unknown keyword or identifier. Did you mean 'class'?
tests/cases/compiler/commonMissingSemicolons.ts(11,1): error TS2304: Cannot find name 'clasd'.
tests/cases/compiler/commonMissingSemicolons.ts(11,7): error TS1434: Unexpected keyword or identifier.
tests/cases/compiler/commonMissingSemicolons.ts(11,7): error TS2552: Cannot find name 'MyClass2'. Did you mean 'MyClass1'?
tests/cases/compiler/commonMissingSemicolons.ts(12,1): error TS1435: Unknown keyword or identifier. Did you mean 'class'?
tests/cases/compiler/commonMissingSemicolons.ts(12,1): error TS2304: Cannot find name 'classs'.
tests/cases/compiler/commonMissingSemicolons.ts(12,8): error TS1434: Unexpected keyword or identifier.
tests/cases/compiler/commonMissingSemicolons.ts(12,8): error TS2552: Cannot find name 'MyClass3'. Did you mean 'MyClass1'?
tests/cases/compiler/commonMissingSemicolons.ts(15,1): error TS1435: Unknown keyword or identifier. Did you mean 'const'?
tests/cases/compiler/commonMissingSemicolons.ts(15,1): error TS2304: Cannot find name 'consd'.
tests/cases/compiler/commonMissingSemicolons.ts(15,7): error TS2552: Cannot find name 'myConst2'. Did you mean 'myConst1'?
tests/cases/compiler/commonMissingSemicolons.ts(16,1): error TS1435: Unknown keyword or identifier. Did you mean 'const'?
tests/cases/compiler/commonMissingSemicolons.ts(16,1): error TS2304: Cannot find name 'constd'.
tests/cases/compiler/commonMissingSemicolons.ts(16,8): error TS2304: Cannot find name 'myConst3'.
tests/cases/compiler/commonMissingSemicolons.ts(19,1): error TS1435: Unknown keyword or identifier. Did you mean 'declare'?
tests/cases/compiler/commonMissingSemicolons.ts(19,1): error TS2304: Cannot find name 'declared'.
tests/cases/compiler/commonMissingSemicolons.ts(20,1): error TS2304: Cannot find name 'declare'.
tests/cases/compiler/commonMissingSemicolons.ts(20,9): error TS1435: Unknown keyword or identifier. Did you mean 'const'?
tests/cases/compiler/commonMissingSemicolons.ts(20,9): error TS2304: Cannot find name 'constd'.
tests/cases/compiler/commonMissingSemicolons.ts(21,1): error TS1435: Unknown keyword or identifier. Did you mean 'declare'?
tests/cases/compiler/commonMissingSemicolons.ts(21,1): error TS2304: Cannot find name 'declared'.
tests/cases/compiler/commonMissingSemicolons.ts(21,10): error TS1435: Unknown keyword or identifier. Did you mean 'const'?
tests/cases/compiler/commonMissingSemicolons.ts(21,10): error TS2304: Cannot find name 'constd'.
tests/cases/compiler/commonMissingSemicolons.ts(22,1): error TS1435: Unknown keyword or identifier. Did you mean 'declare const'?
tests/cases/compiler/commonMissingSemicolons.ts(22,1): error TS2304: Cannot find name 'declareconst'.
tests/cases/compiler/commonMissingSemicolons.ts(22,14): error TS2304: Cannot find name 'myDeclareConst5'.
tests/cases/compiler/commonMissingSemicolons.ts(25,1): error TS1435: Unknown keyword or identifier. Did you mean 'function'?
tests/cases/compiler/commonMissingSemicolons.ts(25,1): error TS2304: Cannot find name 'functiond'.
tests/cases/compiler/commonMissingSemicolons.ts(25,11): error TS2304: Cannot find name 'myFunction2'.
tests/cases/compiler/commonMissingSemicolons.ts(25,25): error TS1005: ';' expected.
tests/cases/compiler/commonMissingSemicolons.ts(26,10): error TS1359: Identifier expected. 'function' is a reserved word that cannot be used here.
tests/cases/compiler/commonMissingSemicolons.ts(26,18): error TS1003: Identifier expected.
tests/cases/compiler/commonMissingSemicolons.ts(27,1): error TS2304: Cannot find name 'functionMyFunction'.
tests/cases/compiler/commonMissingSemicolons.ts(30,1): error TS1435: Unknown keyword or identifier. Did you mean 'interface'?
tests/cases/compiler/commonMissingSemicolons.ts(30,1): error TS2304: Cannot find name 'interfaced'.
tests/cases/compiler/commonMissingSemicolons.ts(30,12): error TS1434: Unexpected keyword or identifier.
tests/cases/compiler/commonMissingSemicolons.ts(30,12): error TS2304: Cannot find name 'myInterface2'.
tests/cases/compiler/commonMissingSemicolons.ts(32,1): error TS2693: 'interface' only refers to a type, but is being used as a value here.
tests/cases/compiler/commonMissingSemicolons.ts(32,11): error TS1438: Interface must be given a name.
tests/cases/compiler/commonMissingSemicolons.ts(33,1): error TS2693: 'interface' only refers to a type, but is being used as a value here.
tests/cases/compiler/commonMissingSemicolons.ts(33,11): error TS2427: Interface name cannot be 'void'.
tests/cases/compiler/commonMissingSemicolons.ts(34,1): error TS1435: Unknown keyword or identifier. Did you mean 'interface MyInterface'?
tests/cases/compiler/commonMissingSemicolons.ts(34,1): error TS2304: Cannot find name 'interfaceMyInterface'.
tests/cases/compiler/commonMissingSemicolons.ts(38,1): error TS1435: Unknown keyword or identifier. Did you mean 'let'?
tests/cases/compiler/commonMissingSemicolons.ts(38,1): error TS2304: Cannot find name 'letd'.
tests/cases/compiler/commonMissingSemicolons.ts(38,6): error TS2304: Cannot find name 'let2'.
tests/cases/compiler/commonMissingSemicolons.ts(39,1): error TS2304: Cannot find name 'letMyLet'.
tests/cases/compiler/commonMissingSemicolons.ts(41,10): error TS1005: '=' expected.
tests/cases/compiler/commonMissingSemicolons.ts(45,1): error TS1435: Unknown keyword or identifier. Did you mean 'type'?
tests/cases/compiler/commonMissingSemicolons.ts(45,1): error TS2304: Cannot find name 'typed'.
tests/cases/compiler/commonMissingSemicolons.ts(45,7): error TS2304: Cannot find name 'type4'.
tests/cases/compiler/commonMissingSemicolons.ts(46,1): error TS1435: Unknown keyword or identifier. Did you mean 'type'?
tests/cases/compiler/commonMissingSemicolons.ts(46,1): error TS2304: Cannot find name 'typed'.
tests/cases/compiler/commonMissingSemicolons.ts(46,7): error TS2304: Cannot find name 'type5'.
tests/cases/compiler/commonMissingSemicolons.ts(46,15): error TS2693: 'type' only refers to a type, but is being used as a value here.
tests/cases/compiler/commonMissingSemicolons.ts(47,1): error TS2304: Cannot find name 'typeMyType'.
tests/cases/compiler/commonMissingSemicolons.ts(50,1): error TS1435: Unknown keyword or identifier. Did you mean 'var'?
tests/cases/compiler/commonMissingSemicolons.ts(50,1): error TS2304: Cannot find name 'vard'.
tests/cases/compiler/commonMissingSemicolons.ts(50,6): error TS2304: Cannot find name 'myVar2'.
tests/cases/compiler/commonMissingSemicolons.ts(51,1): error TS2304: Cannot find name 'varMyVar'.
tests/cases/compiler/commonMissingSemicolons.ts(55,3): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
tests/cases/compiler/commonMissingSemicolons.ts(56,1): error TS1128: Declaration or statement expected.
tests/cases/compiler/commonMissingSemicolons.ts(60,3): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
tests/cases/compiler/commonMissingSemicolons.ts(61,1): error TS1128: Declaration or statement expected.
tests/cases/compiler/commonMissingSemicolons.ts(65,3): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
tests/cases/compiler/commonMissingSemicolons.ts(66,1): error TS1128: Declaration or statement expected.
tests/cases/compiler/commonMissingSemicolons.ts(70,11): error TS1005: ';' expected.
tests/cases/compiler/commonMissingSemicolons.ts(71,1): error TS1128: Declaration or statement expected.
tests/cases/compiler/commonMissingSemicolons.ts(75,11): error TS1005: ';' expected.
tests/cases/compiler/commonMissingSemicolons.ts(78,1): error TS1128: Declaration or statement expected.
==== tests/cases/compiler/commonMissingSemicolons.ts (76 errors) ====
async function myAsyncFunction1() {}
asynd function myAsyncFunction2() {}
~~~~~
!!! error TS1435: Unknown keyword or identifier. Did you mean 'async'?
~~~~~
!!! error TS2304: Cannot find name 'asynd'.
sasync function myAsyncFunction3() {}
~~~~~~
!!! error TS1435: Unknown keyword or identifier. Did you mean 'async'?
~~~~~~
!!! error TS2304: Cannot find name 'sasync'.
// Arrow functions don't (yet?) parse as nicely as standalone functions.
// Eventually it would be good to get them the same "did you mean" for typos such as "asyncd".
const myAsyncArrow1 = async () => 3;
const myAsyncArrow2 = asyncd () => 3;
~~~~~~
!!! error TS2304: Cannot find name 'asyncd'.
~~
!!! error TS1005: ';' expected.
class MyClass1 {}
clasd MyClass2 {}
~~~~~
!!! error TS1435: Unknown keyword or identifier. Did you mean 'class'?
~~~~~
!!! error TS2304: Cannot find name 'clasd'.
~~~~~~~~
!!! error TS1434: Unexpected keyword or identifier.
~~~~~~~~
!!! error TS2552: Cannot find name 'MyClass2'. Did you mean 'MyClass1'?
!!! related TS2728 tests/cases/compiler/commonMissingSemicolons.ts:10:7: 'MyClass1' is declared here.
classs MyClass3 {}
~~~~~~
!!! error TS1435: Unknown keyword or identifier. Did you mean 'class'?
~~~~~~
!!! error TS2304: Cannot find name 'classs'.
~~~~~~~~
!!! error TS1434: Unexpected keyword or identifier.
~~~~~~~~
!!! error TS2552: Cannot find name 'MyClass3'. Did you mean 'MyClass1'?
!!! related TS2728 tests/cases/compiler/commonMissingSemicolons.ts:10:7: 'MyClass1' is declared here.
const myConst1 = 1;
consd myConst2 = 1;
~~~~~
!!! error TS1435: Unknown keyword or identifier. Did you mean 'const'?
~~~~~
!!! error TS2304: Cannot find name 'consd'.
~~~~~~~~
!!! error TS2552: Cannot find name 'myConst2'. Did you mean 'myConst1'?
!!! related TS2728 tests/cases/compiler/commonMissingSemicolons.ts:14:7: 'myConst1' is declared here.
constd myConst3 = 1;
~~~~~~
!!! error TS1435: Unknown keyword or identifier. Did you mean 'const'?
~~~~~~
!!! error TS2304: Cannot find name 'constd'.
~~~~~~~~
!!! error TS2304: Cannot find name 'myConst3'.
declare const myDeclareConst1: 1;
declared const myDeclareConst2: 1;
~~~~~~~~
!!! error TS1435: Unknown keyword or identifier. Did you mean 'declare'?
~~~~~~~~
!!! error TS2304: Cannot find name 'declared'.
declare constd myDeclareConst3: 1;
~~~~~~~
!!! error TS2304: Cannot find name 'declare'.
~~~~~~
!!! error TS1435: Unknown keyword or identifier. Did you mean 'const'?
~~~~~~
!!! error TS2304: Cannot find name 'constd'.
declared constd myDeclareConst4: 1;
~~~~~~~~
!!! error TS1435: Unknown keyword or identifier. Did you mean 'declare'?
~~~~~~~~
!!! error TS2304: Cannot find name 'declared'.
~~~~~~
!!! error TS1435: Unknown keyword or identifier. Did you mean 'const'?
~~~~~~
!!! error TS2304: Cannot find name 'constd'.
declareconst myDeclareConst5;
~~~~~~~~~~~~
!!! error TS1435: Unknown keyword or identifier. Did you mean 'declare const'?
~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'declareconst'.
~~~~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'myDeclareConst5'.
function myFunction1() { }
functiond myFunction2() { }
~~~~~~~~~
!!! error TS1435: Unknown keyword or identifier. Did you mean 'function'?
~~~~~~~~~
!!! error TS2304: Cannot find name 'functiond'.
~~~~~~~~~~~
!!! error TS2304: Cannot find name 'myFunction2'.
~
!!! error TS1005: ';' expected.
function function() { }
~~~~~~~~
!!! error TS1359: Identifier expected. 'function' is a reserved word that cannot be used here.
~
!!! error TS1003: Identifier expected.
functionMyFunction;
~~~~~~~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'functionMyFunction'.
interface myInterface1 { }
interfaced myInterface2 { }
~~~~~~~~~~
!!! error TS1435: Unknown keyword or identifier. Did you mean 'interface'?
~~~~~~~~~~
!!! error TS2304: Cannot find name 'interfaced'.
~~~~~~~~~~~~
!!! error TS1434: Unexpected keyword or identifier.
~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'myInterface2'.
interface interface { }
interface { }
~~~~~~~~~
!!! error TS2693: 'interface' only refers to a type, but is being used as a value here.
~
!!! error TS1438: Interface must be given a name.
interface void { }
~~~~~~~~~
!!! error TS2693: 'interface' only refers to a type, but is being used as a value here.
~~~~
!!! error TS2427: Interface name cannot be 'void'.
interfaceMyInterface { }
~~~~~~~~~~~~~~~~~~~~
!!! error TS1435: Unknown keyword or identifier. Did you mean 'interface MyInterface'?
~~~~~~~~~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'interfaceMyInterface'.
let let = 1;
let let1 = 1;
letd let2 = 1;
~~~~
!!! error TS1435: Unknown keyword or identifier. Did you mean 'let'?
~~~~
!!! error TS2304: Cannot find name 'letd'.
~~~~
!!! error TS2304: Cannot find name 'let2'.
letMyLet;
~~~~~~~~
!!! error TS2304: Cannot find name 'letMyLet'.
type type;
~
!!! error TS1005: '=' expected.
type type1 = {};
type type2 = type;
type type3 = {};
typed type4 = {}
~~~~~
!!! error TS1435: Unknown keyword or identifier. Did you mean 'type'?
~~~~~
!!! error TS2304: Cannot find name 'typed'.
~~~~~
!!! error TS2304: Cannot find name 'type4'.
typed type5 = type;
~~~~~
!!! error TS1435: Unknown keyword or identifier. Did you mean 'type'?
~~~~~
!!! error TS2304: Cannot find name 'typed'.
~~~~~
!!! error TS2304: Cannot find name 'type5'.
~~~~
!!! error TS2693: 'type' only refers to a type, but is being used as a value here.
typeMyType;
~~~~~~~~~~
!!! error TS2304: Cannot find name 'typeMyType'.
var myVar1 = 1;
vard myVar2 = 1;
~~~~
!!! error TS1435: Unknown keyword or identifier. Did you mean 'var'?
~~~~
!!! error TS2304: Cannot find name 'vard'.
~~~~~~
!!! error TS2304: Cannot find name 'myVar2'.
varMyVar;
~~~~~~~~
!!! error TS2304: Cannot find name 'varMyVar'.
class NoSemicolonClassA {
['a'] = 0
{}
~
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
}
~
!!! error TS1128: Declaration or statement expected.
class NoSemicolonClassB {
['a'] = 0
{}
~
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
}
~
!!! error TS1128: Declaration or statement expected.
class NoSemicolonClassC {
['a'] = 0;
{}
~
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
}
~
!!! error TS1128: Declaration or statement expected.
class NoSemicolonClassD {
['a'] = 0
['b']() {}
~
!!! error TS1005: ';' expected.
}
~
!!! error TS1128: Declaration or statement expected.
class NoSemicolonClassE {
['a'] = 0
['b']() {
~
!!! error TS1005: ';' expected.
c: true
}
}
~
!!! error TS1128: Declaration or statement expected.
@@ -0,0 +1,93 @@
=== tests/cases/compiler/commonMissingSemicolons.ts ===
async function myAsyncFunction1() {}
>myAsyncFunction1 : Symbol(myAsyncFunction1, Decl(commonMissingSemicolons.ts, 0, 0))
asynd function myAsyncFunction2() {}
>myAsyncFunction2 : Symbol(myAsyncFunction2, Decl(commonMissingSemicolons.ts, 1, 5))
sasync function myAsyncFunction3() {}
>myAsyncFunction3 : Symbol(myAsyncFunction3, Decl(commonMissingSemicolons.ts, 2, 6))
// Arrow functions don't (yet?) parse as nicely as standalone functions.
// Eventually it would be good to get them the same "did you mean" for typos such as "asyncd".
const myAsyncArrow1 = async () => 3;
>myAsyncArrow1 : Symbol(myAsyncArrow1, Decl(commonMissingSemicolons.ts, 6, 5))
const myAsyncArrow2 = asyncd () => 3;
>myAsyncArrow2 : Symbol(myAsyncArrow2, Decl(commonMissingSemicolons.ts, 7, 5))
class MyClass1 {}
>MyClass1 : Symbol(MyClass1, Decl(commonMissingSemicolons.ts, 7, 37))
clasd MyClass2 {}
classs MyClass3 {}
const myConst1 = 1;
>myConst1 : Symbol(myConst1, Decl(commonMissingSemicolons.ts, 13, 5))
consd myConst2 = 1;
constd myConst3 = 1;
declare const myDeclareConst1: 1;
>myDeclareConst1 : Symbol(myDeclareConst1, Decl(commonMissingSemicolons.ts, 17, 13))
declared const myDeclareConst2: 1;
>myDeclareConst2 : Symbol(myDeclareConst2, Decl(commonMissingSemicolons.ts, 18, 14))
declare constd myDeclareConst3: 1;
declared constd myDeclareConst4: 1;
declareconst myDeclareConst5;
function myFunction1() { }
>myFunction1 : Symbol(myFunction1, Decl(commonMissingSemicolons.ts, 21, 29))
functiond myFunction2() { }
function function() { }
> : Symbol((Missing), Decl(commonMissingSemicolons.ts, 24, 27), Decl(commonMissingSemicolons.ts, 25, 8))
> : Symbol((Missing), Decl(commonMissingSemicolons.ts, 24, 27), Decl(commonMissingSemicolons.ts, 25, 8))
functionMyFunction;
interface myInterface1 { }
>myInterface1 : Symbol(myInterface1, Decl(commonMissingSemicolons.ts, 26, 19))
interfaced myInterface2 { }
interface interface { }
>interface : Symbol(interface, Decl(commonMissingSemicolons.ts, 29, 27))
interface { }
interface void { }
interfaceMyInterface { }
let let = 1;
>let : Symbol(let, Decl(commonMissingSemicolons.ts, 35, 3))
let let1 = 1;
>let1 : Symbol(let1, Decl(commonMissingSemicolons.ts, 36, 3))
letd let2 = 1;
letMyLet;
type type;
>type : Symbol(type, Decl(commonMissingSemicolons.ts, 38, 9))
type type1 = {};
>type1 : Symbol(type1, Decl(commonMissingSemicolons.ts, 40, 10))
type type2 = type;
>type2 : Symbol(type2, Decl(commonMissingSemicolons.ts, 41, 16))
>type : Symbol(type, Decl(commonMissingSemicolons.ts, 38, 9))
type type3 = {};
>type3 : Symbol(type3, Decl(commonMissingSemicolons.ts, 42, 18))
typed type4 = {}
typed type5 = type;
typeMyType;
var myVar1 = 1;
>myVar1 : Symbol(myVar1, Decl(commonMissingSemicolons.ts, 48, 3))
vard myVar2 = 1;
varMyVar;
@@ -0,0 +1,164 @@
=== tests/cases/compiler/commonMissingSemicolons.ts ===
async function myAsyncFunction1() {}
>myAsyncFunction1 : () => Promise<void>
asynd function myAsyncFunction2() {}
>asynd : any
>myAsyncFunction2 : () => void
sasync function myAsyncFunction3() {}
>sasync : any
>myAsyncFunction3 : () => void
// Arrow functions don't (yet?) parse as nicely as standalone functions.
// Eventually it would be good to get them the same "did you mean" for typos such as "asyncd".
const myAsyncArrow1 = async () => 3;
>myAsyncArrow1 : () => Promise<number>
>async () => 3 : () => Promise<number>
>3 : 3
const myAsyncArrow2 = asyncd () => 3;
>myAsyncArrow2 : any
>asyncd () : any
>asyncd : any
>3 : 3
class MyClass1 {}
>MyClass1 : MyClass1
clasd MyClass2 {}
>clasd : any
>MyClass2 : any
classs MyClass3 {}
>classs : any
>MyClass3 : any
const myConst1 = 1;
>myConst1 : 1
>1 : 1
consd myConst2 = 1;
>consd : any
>myConst2 = 1 : 1
>myConst2 : any
>1 : 1
constd myConst3 = 1;
>constd : any
>myConst3 = 1 : 1
>myConst3 : any
>1 : 1
declare const myDeclareConst1: 1;
>myDeclareConst1 : 1
declared const myDeclareConst2: 1;
>declared : any
>myDeclareConst2 : 1
declare constd myDeclareConst3: 1;
>declare : any
>constd : any
>myDeclareConst3 : any
>1 : 1
declared constd myDeclareConst4: 1;
>declared : any
>constd : any
>myDeclareConst4 : any
>1 : 1
declareconst myDeclareConst5;
>declareconst : any
>myDeclareConst5 : any
function myFunction1() { }
>myFunction1 : () => void
functiond myFunction2() { }
>functiond : any
>myFunction2() : any
>myFunction2 : any
function function() { }
> : () => any
> : () => any
functionMyFunction;
>functionMyFunction : any
interface myInterface1 { }
interfaced myInterface2 { }
>interfaced : any
>myInterface2 : any
interface interface { }
interface { }
>interface : any
interface void { }
>interface : any
>void { } : undefined
>{ } : {}
interfaceMyInterface { }
>interfaceMyInterface : any
let let = 1;
>let : number
>1 : 1
let let1 = 1;
>let1 : number
>1 : 1
letd let2 = 1;
>letd : any
>let2 = 1 : 1
>let2 : any
>1 : 1
letMyLet;
>letMyLet : any
type type;
>type : any
type type1 = {};
>type1 : type1
type type2 = type;
>type2 : any
type type3 = {};
>type3 : type3
typed type4 = {}
>typed : any
>type4 = {} : {}
>type4 : any
>{} : {}
typed type5 = type;
>typed : any
>type5 = type : any
>type5 : any
>type : any
typeMyType;
>typeMyType : any
var myVar1 = 1;
>myVar1 : number
>1 : 1
vard myVar2 = 1;
>vard : any
>myVar2 = 1 : 1
>myVar2 : any
>1 : 1
varMyVar;
>varMyVar : any
@@ -1,4 +1,4 @@
tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts(4,12): error TS1005: ';' expected.
tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts(4,12): error TS1436: Decorators must precede the name and all keywords of property declarations.
==== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts (1 errors) ====
@@ -7,5 +7,5 @@ tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts(4
class C {
public @dec get accessor() { return 1; }
~
!!! error TS1005: ';' expected.
!!! error TS1436: Decorators must precede the name and all keywords of property declarations.
}
@@ -1,4 +1,4 @@
tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,12): error TS1005: ';' expected.
tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4,12): error TS1436: Decorators must precede the name and all keywords of property declarations.
==== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts (1 errors) ====
@@ -7,5 +7,5 @@ tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4
class C {
public @dec set accessor(value: number) { }
~
!!! error TS1005: ';' expected.
!!! error TS1436: Decorators must precede the name and all keywords of property declarations.
}
@@ -1,4 +1,4 @@
tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts(4,12): error TS1005: ';' expected.
tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts(4,12): error TS1436: Decorators must precede the name and all keywords of property declarations.
==== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts (1 errors) ====
@@ -7,5 +7,5 @@ tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts(4,12)
class C {
public @dec method() {}
~
!!! error TS1005: ';' expected.
!!! error TS1436: Decorators must precede the name and all keywords of property declarations.
}
@@ -1,4 +1,4 @@
tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts(4,12): error TS1005: ';' expected.
tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts(4,12): error TS1436: Decorators must precede the name and all keywords of property declarations.
==== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts (1 errors) ====
@@ -7,5 +7,5 @@ tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts(4
class C {
public @dec prop;
~
!!! error TS1005: ';' expected.
!!! error TS1436: Decorators must precede the name and all keywords of property declarations.
}
@@ -1,43 +1,18 @@
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(8,8): error TS2304: Cannot find name 'super'.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(8,13): error TS1005: ';' expected.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(8,14): error TS1109: Expression expected.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(9,5): error TS2304: Cannot find name 'b'.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(9,9): error TS1005: ';' expected.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(8,13): error TS1441: Cannot start a function call in a type annotation.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(8,14): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(10,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(12,5): error TS2304: Cannot find name 'get'.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(12,9): error TS1005: ';' expected.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(12,9): error TS2304: Cannot find name 'C'.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(12,13): error TS1005: ';' expected.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(13,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(16,5): error TS2304: Cannot find name 'set'.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(16,9): error TS1005: ';' expected.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(16,9): error TS2304: Cannot find name 'C'.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(16,11): error TS2304: Cannot find name 'v'.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(16,14): error TS1005: ';' expected.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(17,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(20,5): error TS1128: Declaration or statement expected.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(20,15): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(21,5): error TS1128: Declaration or statement expected.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(21,12): error TS2304: Cannot find name 'b'.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(21,16): error TS1005: ';' expected.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(20,15): error TS2304: Cannot find name 'super'.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(20,20): error TS1441: Cannot start a function call in a type annotation.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(20,21): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(22,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(24,5): error TS1128: Declaration or statement expected.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(24,12): error TS2304: Cannot find name 'get'.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(24,16): error TS1005: ';' expected.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(24,16): error TS2304: Cannot find name 'C'.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(24,20): error TS1005: ';' expected.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(25,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(28,5): error TS1128: Declaration or statement expected.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(28,12): error TS2304: Cannot find name 'set'.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(28,16): error TS1005: ';' expected.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(28,16): error TS2304: Cannot find name 'C'.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(28,18): error TS2304: Cannot find name 'v'.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(28,21): error TS1005: ';' expected.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(29,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(31,1): error TS1128: Declaration or statement expected.
==== tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts (37 errors) ====
==== tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts (12 errors) ====
// error to use super calls outside a constructor
class Base {
@@ -49,97 +24,47 @@ tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassS
~~~~~
!!! error TS2304: Cannot find name 'super'.
~
!!! error TS1005: ';' expected.
!!! error TS1441: Cannot start a function call in a type annotation.
~
!!! error TS1109: Expression expected.
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
b() {
~
!!! error TS2304: Cannot find name 'b'.
~
!!! error TS1005: ';' expected.
super();
~~~~~
!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
}
get C() {
~~~
!!! error TS2304: Cannot find name 'get'.
~
!!! error TS1005: ';' expected.
~
!!! error TS2304: Cannot find name 'C'.
~
!!! error TS1005: ';' expected.
super();
~~~~~
!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
return 1;
}
set C(v) {
~~~
!!! error TS2304: Cannot find name 'set'.
~
!!! error TS1005: ';' expected.
~
!!! error TS2304: Cannot find name 'C'.
~
!!! error TS2304: Cannot find name 'v'.
~
!!! error TS1005: ';' expected.
super();
~~~~~
!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
}
static a: super();
~~~~~~
!!! error TS1128: Declaration or statement expected.
~~~~~
!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
!!! error TS2304: Cannot find name 'super'.
~
!!! error TS1441: Cannot start a function call in a type annotation.
~
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
static b() {
~~~~~~
!!! error TS1128: Declaration or statement expected.
~
!!! error TS2304: Cannot find name 'b'.
~
!!! error TS1005: ';' expected.
super();
~~~~~
!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
}
static get C() {
~~~~~~
!!! error TS1128: Declaration or statement expected.
~~~
!!! error TS2304: Cannot find name 'get'.
~
!!! error TS1005: ';' expected.
~
!!! error TS2304: Cannot find name 'C'.
~
!!! error TS1005: ';' expected.
super();
~~~~~
!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
return 1;
}
static set C(v) {
~~~~~~
!!! error TS1128: Declaration or statement expected.
~~~
!!! error TS2304: Cannot find name 'set'.
~
!!! error TS1005: ';' expected.
~
!!! error TS2304: Cannot find name 'C'.
~
!!! error TS2304: Cannot find name 'v'.
~
!!! error TS1005: ';' expected.
super();
~~~~~
!!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors.
}
}
~
!!! error TS1128: Declaration or statement expected.
}
@@ -58,37 +58,35 @@ var Derived = /** @class */ (function (_super) {
function Derived() {
return _super !== null && _super.apply(this, arguments) || this;
}
;
Derived.prototype.b = function () {
_this = _super.call(this) || this;
};
Object.defineProperty(Derived.prototype, "C", {
get: function () {
_this = _super.call(this) || this;
return 1;
},
set: function (v) {
_this = _super.call(this) || this;
},
enumerable: false,
configurable: true
});
;
Derived.b = function () {
_this = _super.call(this) || this;
};
Object.defineProperty(Derived, "C", {
get: function () {
_this = _super.call(this) || this;
return 1;
},
set: function (v) {
_this = _super.call(this) || this;
},
enumerable: false,
configurable: true
});
return Derived;
}(Base));
();
b();
{
_this = _super.call(this) || this;
}
get;
C();
{
_this = _super.call(this) || this;
return 1;
}
set;
C(v);
{
_this = _super.call(this) || this;
}
a: _this = _super.call(this) || this;
b();
{
_this = _super.call(this) || this;
}
get;
C();
{
_this = _super.call(this) || this;
return 1;
}
set;
C(v);
{
_this = _super.call(this) || this;
}
@@ -16,25 +16,41 @@ class Derived extends Base {
>a : Symbol(Derived.a, Decl(derivedClassSuperCallsInNonConstructorMembers.ts, 6, 28))
b() {
>b : Symbol(Derived.b, Decl(derivedClassSuperCallsInNonConstructorMembers.ts, 7, 15))
super();
}
get C() {
>C : Symbol(Derived.C, Decl(derivedClassSuperCallsInNonConstructorMembers.ts, 10, 5), Decl(derivedClassSuperCallsInNonConstructorMembers.ts, 14, 5))
super();
return 1;
}
set C(v) {
>C : Symbol(Derived.C, Decl(derivedClassSuperCallsInNonConstructorMembers.ts, 10, 5), Decl(derivedClassSuperCallsInNonConstructorMembers.ts, 14, 5))
>v : Symbol(v, Decl(derivedClassSuperCallsInNonConstructorMembers.ts, 15, 10))
super();
}
static a: super();
>a : Symbol(Derived.a, Decl(derivedClassSuperCallsInNonConstructorMembers.ts, 17, 5))
static b() {
>b : Symbol(Derived.b, Decl(derivedClassSuperCallsInNonConstructorMembers.ts, 19, 22))
super();
}
static get C() {
>C : Symbol(Derived.C, Decl(derivedClassSuperCallsInNonConstructorMembers.ts, 22, 5), Decl(derivedClassSuperCallsInNonConstructorMembers.ts, 26, 5))
super();
return 1;
}
static set C(v) {
>C : Symbol(Derived.C, Decl(derivedClassSuperCallsInNonConstructorMembers.ts, 22, 5), Decl(derivedClassSuperCallsInNonConstructorMembers.ts, 26, 5))
>v : Symbol(v, Decl(derivedClassSuperCallsInNonConstructorMembers.ts, 27, 17))
super();
}
}
@@ -14,21 +14,16 @@ class Derived extends Base {
a: super();
>a : any
>() : any
> : any
b() {
>b() : any
>b : any
>b : () => void
super();
>super() : void
>super : any
}
get C() {
>get : any
>C() : any
>C : any
>C : number
super();
>super() : void
@@ -38,10 +33,8 @@ class Derived extends Base {
>1 : 1
}
set C(v) {
>set : any
>C(v) : any
>C : any
>v : any
>C : number
>v : number
super();
>super() : void
@@ -50,21 +43,16 @@ class Derived extends Base {
static a: super();
>a : any
>super() : void
>super : any
static b() {
>b() : any
>b : any
>b : () => void
super();
>super() : void
>super : any
}
static get C() {
>get : any
>C() : any
>C : any
>C : number
super();
>super() : void
@@ -74,10 +62,8 @@ class Derived extends Base {
>1 : 1
}
static set C(v) {
>set : any
>C(v) : any
>C : any
>v : any
>C : number
>v : number
super();
>super() : void
@@ -1,14 +1,14 @@
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(1,10): error TS1003: Identifier expected.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(1,10): error TS1141: String literal expected.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(1,12): error TS1109: Expression expected.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(1,14): error TS1434: Unexpected keyword or identifier.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(1,14): error TS2304: Cannot find name 'from'.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(1,19): error TS1005: ';' expected.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(2,8): error TS1192: Module '"tests/cases/compiler/es6ImportNamedImportParsingError_0"' has no default export.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(2,24): error TS1005: '{' expected.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(3,1): error TS1128: Declaration or statement expected.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(3,8): error TS1128: Declaration or statement expected.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(3,16): error TS1434: Unexpected keyword or identifier.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(3,16): error TS2304: Cannot find name 'from'.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(3,21): error TS1005: ';' expected.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(4,13): error TS1005: 'from' expected.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(4,13): error TS1141: String literal expected.
tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(4,20): error TS1005: ';' expected.
@@ -28,9 +28,9 @@ tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(4,20): error TS1005:
~
!!! error TS1109: Expression expected.
~~~~
!!! error TS1434: Unexpected keyword or identifier.
~~~~
!!! error TS2304: Cannot find name 'from'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS1005: ';' expected.
import defaultBinding, from "es6ImportNamedImportParsingError_0";
~~~~~~~~~~~~~~
!!! error TS1192: Module '"tests/cases/compiler/es6ImportNamedImportParsingError_0"' has no default export.
@@ -42,9 +42,9 @@ tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(4,20): error TS1005:
~
!!! error TS1128: Declaration or statement expected.
~~~~
!!! error TS1434: Unexpected keyword or identifier.
~~~~
!!! error TS2304: Cannot find name 'from'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS1005: ';' expected.
import { a }, from "es6ImportNamedImportParsingError_0";
~
!!! error TS1005: 'from' expected.
@@ -1,7 +1,7 @@
tests/cases/compiler/extension.ts(10,18): error TS2300: Duplicate identifier 'C'.
tests/cases/compiler/extension.ts(16,5): error TS1128: Declaration or statement expected.
tests/cases/compiler/extension.ts(16,12): error TS1434: Unexpected keyword or identifier.
tests/cases/compiler/extension.ts(16,12): error TS2304: Cannot find name 'extension'.
tests/cases/compiler/extension.ts(16,22): error TS1005: ';' expected.
tests/cases/compiler/extension.ts(16,28): error TS2300: Duplicate identifier 'C'.
tests/cases/compiler/extension.ts(22,3): error TS2339: Property 'pe' does not exist on type 'C'.
@@ -28,9 +28,9 @@ tests/cases/compiler/extension.ts(22,3): error TS2339: Property 'pe' does not ex
~~~~~~
!!! error TS1128: Declaration or statement expected.
~~~~~~~~~
!!! error TS1434: Unexpected keyword or identifier.
~~~~~~~~~
!!! error TS2304: Cannot find name 'extension'.
~~~~~
!!! error TS1005: ';' expected.
~
!!! error TS2300: Duplicate identifier 'C'.
public pe:string;
@@ -1,7 +1,6 @@
tests/cases/compiler/externModule.ts(1,1): error TS2304: Cannot find name 'declare'.
tests/cases/compiler/externModule.ts(1,9): error TS1005: ';' expected.
tests/cases/compiler/externModule.ts(1,9): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
tests/cases/compiler/externModule.ts(1,16): error TS1005: ';' expected.
tests/cases/compiler/externModule.ts(1,16): error TS1437: Namespace must be given a name.
tests/cases/compiler/externModule.ts(3,10): error TS2391: Function implementation is missing or not immediately following the declaration.
tests/cases/compiler/externModule.ts(4,10): error TS2391: Function implementation is missing or not immediately following the declaration.
tests/cases/compiler/externModule.ts(18,6): error TS2390: Constructor implementation is missing.
@@ -14,16 +13,14 @@ tests/cases/compiler/externModule.ts(36,7): error TS2552: Cannot find name 'XDat
tests/cases/compiler/externModule.ts(37,3): error TS2552: Cannot find name 'XDate'. Did you mean 'Date'?
==== tests/cases/compiler/externModule.ts (14 errors) ====
==== tests/cases/compiler/externModule.ts (13 errors) ====
declare module {
~~~~~~~
!!! error TS2304: Cannot find name 'declare'.
~~~~~~
!!! error TS1005: ';' expected.
~~~~~~
!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
~
!!! error TS1005: ';' expected.
!!! error TS1437: Namespace must be given a name.
export class XDate {
public getDay():number;
~~~~~~
@@ -1,5 +1,5 @@
tests/cases/compiler/innerModExport1.ts(5,5): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
tests/cases/compiler/innerModExport1.ts(5,12): error TS1005: ';' expected.
tests/cases/compiler/innerModExport1.ts(5,12): error TS1437: Namespace must be given a name.
==== tests/cases/compiler/innerModExport1.ts (2 errors) ====
@@ -11,7 +11,7 @@ tests/cases/compiler/innerModExport1.ts(5,12): error TS1005: ';' expected.
~~~~~~
!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
~
!!! error TS1005: ';' expected.
!!! error TS1437: Namespace must be given a name.
var non_export_var = 0;
export var export_var = 1;
@@ -1,5 +1,5 @@
tests/cases/compiler/innerModExport2.ts(5,5): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
tests/cases/compiler/innerModExport2.ts(5,12): error TS1005: ';' expected.
tests/cases/compiler/innerModExport2.ts(5,12): error TS1437: Namespace must be given a name.
tests/cases/compiler/innerModExport2.ts(7,20): error TS2395: Individual declarations in merged declaration 'export_var' must be all exported or all local.
tests/cases/compiler/innerModExport2.ts(13,9): error TS2395: Individual declarations in merged declaration 'export_var' must be all exported or all local.
tests/cases/compiler/innerModExport2.ts(20,7): error TS2339: Property 'NonExportFunc' does not exist on type 'typeof Outer'.
@@ -14,7 +14,7 @@ tests/cases/compiler/innerModExport2.ts(20,7): error TS2339: Property 'NonExport
~~~~~~
!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
~
!!! error TS1005: ';' expected.
!!! error TS1437: Namespace must be given a name.
var non_export_var = 0;
export var export_var = 1;
~~~~~~~~~~
@@ -6,8 +6,8 @@ tests/cases/compiler/interfaceDeclaration4.ts(27,7): error TS2420: Class 'C2' in
tests/cases/compiler/interfaceDeclaration4.ts(36,7): error TS2420: Class 'C3' incorrectly implements interface 'I1'.
Property 'item' is missing in type 'C3' but required in type 'I1'.
tests/cases/compiler/interfaceDeclaration4.ts(39,14): error TS1005: '{' expected.
tests/cases/compiler/interfaceDeclaration4.ts(39,15): error TS1434: Unexpected keyword or identifier.
tests/cases/compiler/interfaceDeclaration4.ts(39,15): error TS2304: Cannot find name 'I1'.
tests/cases/compiler/interfaceDeclaration4.ts(39,18): error TS1005: ';' expected.
==== tests/cases/compiler/interfaceDeclaration4.ts (6 errors) ====
@@ -65,7 +65,7 @@ tests/cases/compiler/interfaceDeclaration4.ts(39,18): error TS1005: ';' expected
~
!!! error TS1005: '{' expected.
~~
!!! error TS1434: Unexpected keyword or identifier.
~~
!!! error TS2304: Cannot find name 'I1'.
~
!!! error TS1005: ';' expected.
@@ -1,5 +1,5 @@
tests/cases/compiler/interfaceNaming1.ts(1,1): error TS2693: 'interface' only refers to a type, but is being used as a value here.
tests/cases/compiler/interfaceNaming1.ts(1,11): error TS1005: ';' expected.
tests/cases/compiler/interfaceNaming1.ts(1,11): error TS1438: Interface must be given a name.
tests/cases/compiler/interfaceNaming1.ts(3,1): error TS2693: 'interface' only refers to a type, but is being used as a value here.
tests/cases/compiler/interfaceNaming1.ts(3,13): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.
@@ -9,7 +9,7 @@ tests/cases/compiler/interfaceNaming1.ts(3,13): error TS2363: The right-hand sid
~~~~~~~~~
!!! error TS2693: 'interface' only refers to a type, but is being used as a value here.
~
!!! error TS1005: ';' expected.
!!! error TS1438: Interface must be given a name.
interface interface{ }
interface & { }
~~~~~~~~~
@@ -3,7 +3,7 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfacesWithPredefine
tests/cases/conformance/interfaces/interfaceDeclarations/interfacesWithPredefinedTypesAsNames.ts(3,11): error TS2427: Interface name cannot be 'string'.
tests/cases/conformance/interfaces/interfaceDeclarations/interfacesWithPredefinedTypesAsNames.ts(4,11): error TS2427: Interface name cannot be 'boolean'.
tests/cases/conformance/interfaces/interfaceDeclarations/interfacesWithPredefinedTypesAsNames.ts(5,1): error TS2304: Cannot find name 'interface'.
tests/cases/conformance/interfaces/interfaceDeclarations/interfacesWithPredefinedTypesAsNames.ts(5,11): error TS1005: ';' expected.
tests/cases/conformance/interfaces/interfaceDeclarations/interfacesWithPredefinedTypesAsNames.ts(5,11): error TS2427: Interface name cannot be 'void'.
tests/cases/conformance/interfaces/interfaceDeclarations/interfacesWithPredefinedTypesAsNames.ts(6,11): error TS2427: Interface name cannot be 'unknown'.
tests/cases/conformance/interfaces/interfaceDeclarations/interfacesWithPredefinedTypesAsNames.ts(7,11): error TS2427: Interface name cannot be 'never'.
@@ -25,7 +25,7 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfacesWithPredefine
~~~~~~~~~
!!! error TS2304: Cannot find name 'interface'.
~~~~
!!! error TS1005: ';' expected.
!!! error TS2427: Interface name cannot be 'void'.
interface unknown {}
~~~~~~~
!!! error TS2427: Interface name cannot be 'unknown'.
@@ -2,13 +2,12 @@ tests/cases/conformance/externalModules/1.ts(1,10): error TS1005: 'as' expected.
tests/cases/conformance/externalModules/1.ts(1,15): error TS1005: 'from' expected.
tests/cases/conformance/externalModules/1.ts(1,15): error TS1141: String literal expected.
tests/cases/conformance/externalModules/1.ts(1,20): error TS1005: ';' expected.
tests/cases/conformance/externalModules/1.ts(1,25): error TS1005: ';' expected.
==== tests/cases/conformance/externalModules/0.ts (0 errors) ====
export class C { }
==== tests/cases/conformance/externalModules/1.ts (5 errors) ====
==== tests/cases/conformance/externalModules/1.ts (4 errors) ====
import * from Zero from "./0"
~~~~
!!! error TS1005: 'as' expected.
@@ -17,6 +16,4 @@ tests/cases/conformance/externalModules/1.ts(1,25): error TS1005: ';' expected.
~~~~
!!! error TS1141: String literal expected.
~~~~
!!! error TS1005: ';' expected.
~~~~~
!!! error TS1005: ';' expected.
@@ -2,13 +2,12 @@ tests/cases/conformance/externalModules/1.ts(1,10): error TS1005: 'as' expected.
tests/cases/conformance/externalModules/1.ts(1,15): error TS1005: 'from' expected.
tests/cases/conformance/externalModules/1.ts(1,15): error TS1141: String literal expected.
tests/cases/conformance/externalModules/1.ts(1,20): error TS1005: ';' expected.
tests/cases/conformance/externalModules/1.ts(1,25): error TS1005: ';' expected.
==== tests/cases/conformance/externalModules/0.ts (0 errors) ====
export class C { }
==== tests/cases/conformance/externalModules/1.ts (5 errors) ====
==== tests/cases/conformance/externalModules/1.ts (4 errors) ====
import * from Zero from "./0"
~~~~
!!! error TS1005: 'as' expected.
@@ -17,6 +16,4 @@ tests/cases/conformance/externalModules/1.ts(1,25): error TS1005: ';' expected.
~~~~
!!! error TS1141: String literal expected.
~~~~
!!! error TS1005: ';' expected.
~~~~~
!!! error TS1005: ';' expected.
@@ -2,13 +2,12 @@ tests/cases/conformance/externalModules/1.ts(1,10): error TS1005: 'as' expected.
tests/cases/conformance/externalModules/1.ts(1,15): error TS1005: 'from' expected.
tests/cases/conformance/externalModules/1.ts(1,15): error TS1141: String literal expected.
tests/cases/conformance/externalModules/1.ts(1,20): error TS1005: ';' expected.
tests/cases/conformance/externalModules/1.ts(1,25): error TS1005: ';' expected.
==== tests/cases/conformance/externalModules/0.ts (0 errors) ====
export class C { }
==== tests/cases/conformance/externalModules/1.ts (5 errors) ====
==== tests/cases/conformance/externalModules/1.ts (4 errors) ====
import * from Zero from "./0"
~~~~
!!! error TS1005: 'as' expected.
@@ -17,6 +16,4 @@ tests/cases/conformance/externalModules/1.ts(1,25): error TS1005: ';' expected.
~~~~
!!! error TS1141: String literal expected.
~~~~
!!! error TS1005: ';' expected.
~~~~~
!!! error TS1005: ';' expected.
@@ -2,8 +2,8 @@ tests/cases/compiler/parseErrorIncorrectReturnToken.ts(2,17): error TS1005: ':'
tests/cases/compiler/parseErrorIncorrectReturnToken.ts(4,22): error TS1005: '=>' expected.
tests/cases/compiler/parseErrorIncorrectReturnToken.ts(4,24): error TS2693: 'string' only refers to a type, but is being used as a value here.
tests/cases/compiler/parseErrorIncorrectReturnToken.ts(9,18): error TS1005: '{' expected.
tests/cases/compiler/parseErrorIncorrectReturnToken.ts(9,21): error TS1434: Unexpected keyword or identifier.
tests/cases/compiler/parseErrorIncorrectReturnToken.ts(9,21): error TS2693: 'string' only refers to a type, but is being used as a value here.
tests/cases/compiler/parseErrorIncorrectReturnToken.ts(9,28): error TS1005: ';' expected.
tests/cases/compiler/parseErrorIncorrectReturnToken.ts(12,1): error TS1128: Declaration or statement expected.
@@ -27,9 +27,9 @@ tests/cases/compiler/parseErrorIncorrectReturnToken.ts(12,1): error TS1128: Decl
!!! error TS1005: '{' expected.
!!! related TS1007 tests/cases/compiler/parseErrorIncorrectReturnToken.ts:8:9: The parser expected to find a '}' to match the '{' token here.
~~~~~~
!!! error TS1434: Unexpected keyword or identifier.
~~~~~~
!!! error TS2693: 'string' only refers to a type, but is being used as a value here.
~
!!! error TS1005: ';' expected.
return n.toString();
}
};
@@ -5,8 +5,8 @@ tests/cases/conformance/parser/ecmascript2021/numericSeparators/12.ts(1,2): erro
tests/cases/conformance/parser/ecmascript2021/numericSeparators/13.ts(1,3): error TS6188: Numeric separators are not allowed here.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/14.ts(1,4): error TS6188: Numeric separators are not allowed here.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/15.ts(1,5): error TS6188: Numeric separators are not allowed here.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/16.ts(1,1): error TS1434: Unexpected keyword or identifier.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/16.ts(1,1): error TS2304: Cannot find name '_0'.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/16.ts(1,3): error TS1005: ';' expected.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/17.ts(1,6): error TS6188: Numeric separators are not allowed here.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/18.ts(1,3): error TS6189: Multiple consecutive numeric separators are not permitted.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/19.ts(1,5): error TS6189: Multiple consecutive numeric separators are not permitted.
@@ -20,8 +20,8 @@ tests/cases/conformance/parser/ecmascript2021/numericSeparators/25.ts(1,2): erro
tests/cases/conformance/parser/ecmascript2021/numericSeparators/26.ts(1,3): error TS6188: Numeric separators are not allowed here.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/27.ts(1,4): error TS6188: Numeric separators are not allowed here.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/28.ts(1,6): error TS6188: Numeric separators are not allowed here.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/29.ts(1,1): error TS1434: Unexpected keyword or identifier.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/29.ts(1,1): error TS2304: Cannot find name '_0'.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/29.ts(1,3): error TS1005: ';' expected.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/3.ts(1,3): error TS6189: Multiple consecutive numeric separators are not permitted.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/30.ts(1,7): error TS6188: Numeric separators are not allowed here.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/31.ts(1,3): error TS6189: Multiple consecutive numeric separators are not permitted.
@@ -36,8 +36,8 @@ tests/cases/conformance/parser/ecmascript2021/numericSeparators/39.ts(1,3): erro
tests/cases/conformance/parser/ecmascript2021/numericSeparators/4.ts(1,2): error TS6188: Numeric separators are not allowed here.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/40.ts(1,4): error TS6188: Numeric separators are not allowed here.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/41.ts(1,6): error TS6188: Numeric separators are not allowed here.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/42.ts(1,1): error TS1434: Unexpected keyword or identifier.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/42.ts(1,1): error TS2304: Cannot find name '_0'.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/42.ts(1,3): error TS1005: ';' expected.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/43.ts(1,7): error TS6188: Numeric separators are not allowed here.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/44.ts(1,3): error TS6189: Multiple consecutive numeric separators are not permitted.
tests/cases/conformance/parser/ecmascript2021/numericSeparators/45.ts(1,5): error TS6189: Multiple consecutive numeric separators are not permitted.
@@ -136,9 +136,9 @@ tests/cases/conformance/parser/ecmascript2021/numericSeparators/9.ts(1,3): error
==== tests/cases/conformance/parser/ecmascript2021/numericSeparators/16.ts (2 errors) ====
_0.0e0
~~
!!! error TS1434: Unexpected keyword or identifier.
~~
!!! error TS2304: Cannot find name '_0'.
~~~~
!!! error TS1005: ';' expected.
==== tests/cases/conformance/parser/ecmascript2021/numericSeparators/17.ts (1 errors) ====
0.0e0_
@@ -203,9 +203,9 @@ tests/cases/conformance/parser/ecmascript2021/numericSeparators/9.ts(1,3): error
==== tests/cases/conformance/parser/ecmascript2021/numericSeparators/29.ts (2 errors) ====
_0.0e+0
~~
!!! error TS1434: Unexpected keyword or identifier.
~~
!!! error TS2304: Cannot find name '_0'.
~~~~~
!!! error TS1005: ';' expected.
==== tests/cases/conformance/parser/ecmascript2021/numericSeparators/30.ts (1 errors) ====
0.0e+0_
@@ -270,9 +270,9 @@ tests/cases/conformance/parser/ecmascript2021/numericSeparators/9.ts(1,3): error
==== tests/cases/conformance/parser/ecmascript2021/numericSeparators/42.ts (2 errors) ====
_0.0e-0
~~
!!! error TS1434: Unexpected keyword or identifier.
~~
!!! error TS2304: Cannot find name '_0'.
~~~~~
!!! error TS1005: ';' expected.
==== tests/cases/conformance/parser/ecmascript2021/numericSeparators/43.ts (1 errors) ====
0.0e-0_
@@ -1,6 +1,6 @@
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,28): error TS2304: Cannot find name 'DisplayPosition'.
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,45): error TS1137: Expression or comma expected.
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,46): error TS1005: ';' expected.
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,46): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,49): error TS1005: ';' expected.
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,51): error TS2300: Duplicate identifier '3'.
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,52): error TS1005: ';' expected.
@@ -26,13 +26,14 @@ tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,82): error T
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,84): error TS2300: Duplicate identifier '0'.
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,85): error TS1005: ';' expected.
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,86): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,94): error TS1005: ';' expected.
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,88): error TS1434: Unexpected keyword or identifier.
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,94): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,96): error TS2300: Duplicate identifier '0'.
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,97): error TS1005: ';' expected.
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(3,25): error TS2304: Cannot find name 'SeedCoords'.
==== tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts (32 errors) ====
==== tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts (33 errors) ====
export class Game {
private position = new DisplayPosition([), 3, 3, 3, 3, 3, 0, 3, 3, 3, 3, 3, 3, 0], NoMove, 0);
~~~~~~~~~~~~~~~
@@ -40,7 +41,7 @@ tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(3,25): error T
~
!!! error TS1137: Expression or comma expected.
~
!!! error TS1005: ';' expected.
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
~
!!! error TS1005: ';' expected.
~
@@ -91,8 +92,10 @@ tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(3,25): error T
!!! error TS1005: ';' expected.
~
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
~~~~~~
!!! error TS1434: Unexpected keyword or identifier.
~
!!! error TS1005: ';' expected.
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
~
!!! error TS2300: Duplicate identifier '0'.
~
@@ -1,5 +1,5 @@
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/IncompleteMemberVariables/parserErrorRecovery_IncompleteMemberVariable2.ts(12,20): error TS2304: Cannot find name 'C'.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/IncompleteMemberVariables/parserErrorRecovery_IncompleteMemberVariable2.ts(12,22): error TS1005: ';' expected.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/IncompleteMemberVariables/parserErrorRecovery_IncompleteMemberVariable2.ts(12,22): error TS1442: Missing '=' before default property value.
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/IncompleteMemberVariables/parserErrorRecovery_IncompleteMemberVariable2.ts (2 errors) ====
@@ -18,7 +18,7 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/IncompleteMemberVariabl
~
!!! error TS2304: Cannot find name 'C'.
~~~~~~~
!!! error TS1005: ';' expected.
!!! error TS1442: Missing '=' before default property value.
// Constructor
constructor (public x: number, public y: number) { }
@@ -1,12 +1,13 @@
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserFuzz1.ts(1,1): error TS2304: Cannot find name 'cla'.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserFuzz1.ts(1,6): error TS2304: Cannot find name 'ss'.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserFuzz1.ts(1,9): error TS1005: ';' expected.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserFuzz1.ts(2,3): error TS1434: Unexpected keyword or identifier.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserFuzz1.ts(2,3): error TS2304: Cannot find name '_'.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserFuzz1.ts(2,5): error TS1005: ';' expected.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserFuzz1.ts(2,5): error TS1128: Declaration or statement expected.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserFuzz1.ts(2,15): error TS1005: '{' expected.
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserFuzz1.ts (6 errors) ====
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserFuzz1.ts (7 errors) ====
cla <ss {
~~~
!!! error TS2304: Cannot find name 'cla'.
@@ -16,9 +17,11 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserFuzz1.ts(2,15): e
!!! error TS1005: ';' expected.
_ static try
~
!!! error TS1434: Unexpected keyword or identifier.
~
!!! error TS2304: Cannot find name '_'.
~~~~~~
!!! error TS1005: ';' expected.
!!! error TS1128: Declaration or statement expected.
!!! error TS1005: '{' expected.
!!! related TS1007 tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserFuzz1.ts:1:9: The parser expected to find a '}' to match the '{' token here.
@@ -1,7 +1,7 @@
tests/cases/conformance/parser/ecmascript5/SkippedTokens/parserSkippedTokens16.ts(1,1): error TS2552: Cannot find name 'foo'. Did you mean 'Foo'?
tests/cases/conformance/parser/ecmascript5/SkippedTokens/parserSkippedTokens16.ts(1,6): error TS1005: ';' expected.
tests/cases/conformance/parser/ecmascript5/SkippedTokens/parserSkippedTokens16.ts(1,8): error TS1434: Unexpected keyword or identifier.
tests/cases/conformance/parser/ecmascript5/SkippedTokens/parserSkippedTokens16.ts(1,8): error TS2304: Cannot find name 'Bar'.
tests/cases/conformance/parser/ecmascript5/SkippedTokens/parserSkippedTokens16.ts(1,12): error TS1005: ';' expected.
tests/cases/conformance/parser/ecmascript5/SkippedTokens/parserSkippedTokens16.ts(2,22): error TS1127: Invalid character.
tests/cases/conformance/parser/ecmascript5/SkippedTokens/parserSkippedTokens16.ts(3,3): error TS1109: Expression expected.
tests/cases/conformance/parser/ecmascript5/SkippedTokens/parserSkippedTokens16.ts(6,5): error TS1138: Parameter declaration expected.
@@ -16,9 +16,9 @@ tests/cases/conformance/parser/ecmascript5/SkippedTokens/parserSkippedTokens16.t
~
!!! error TS1005: ';' expected.
~~~
!!! error TS1434: Unexpected keyword or identifier.
~~~
!!! error TS2304: Cannot find name 'Bar'.
~
!!! error TS1005: ';' expected.
function Foo () ¬ { }
~
!!! error TS1127: Invalid character.
@@ -1,5 +1,5 @@
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGeneric2.ts(2,5): error TS1435: Unknown keyword or identifier. Did you mean 'interface ICompiledExpression'?
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGeneric2.ts(2,5): error TS2304: Cannot find name 'interfaceICompiledExpression'.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGeneric2.ts(2,34): error TS1005: ';' expected.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGeneric2.ts(3,42): error TS1005: '=>' expected.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGeneric2.ts(4,9): error TS2304: Cannot find name 'assign'.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGeneric2.ts(4,16): error TS2304: Cannot find name 'context'.
@@ -19,9 +19,9 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserUnterminatedGener
declare module ng {
interfaceICompiledExpression {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS1435: Unknown keyword or identifier. Did you mean 'interface ICompiledExpression'?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2304: Cannot find name 'interfaceICompiledExpression'.
~
!!! error TS1005: ';' expected.
(context: any, locals?: any): any;
~
!!! error TS1005: '=>' expected.
@@ -3,7 +3,7 @@ tests/cases/conformance/classes/members/accessibility/privateInstanceMemberAcces
tests/cases/conformance/classes/members/accessibility/privateInstanceMemberAccessibility.ts(6,15): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword.
tests/cases/conformance/classes/members/accessibility/privateInstanceMemberAccessibility.ts(8,22): error TS2340: Only public and protected methods of the base class are accessible via the 'super' keyword.
tests/cases/conformance/classes/members/accessibility/privateInstanceMemberAccessibility.ts(10,15): error TS2304: Cannot find name 'super'.
tests/cases/conformance/classes/members/accessibility/privateInstanceMemberAccessibility.ts(12,12): error TS1005: ';' expected.
tests/cases/conformance/classes/members/accessibility/privateInstanceMemberAccessibility.ts(12,12): error TS1442: Missing '=' before default property value.
==== tests/cases/conformance/classes/members/accessibility/privateInstanceMemberAccessibility.ts (5 errors) ====
@@ -29,5 +29,5 @@ tests/cases/conformance/classes/members/accessibility/privateInstanceMemberAcces
a: this.foo; // error
~
!!! error TS1005: ';' expected.
!!! error TS1442: Missing '=' before default property value.
}
@@ -3,7 +3,7 @@ tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(3,6): error
tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(4,6): error TS2457: Type alias name cannot be 'boolean'.
tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(5,6): error TS2457: Type alias name cannot be 'string'.
tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,1): error TS2304: Cannot find name 'type'.
tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,6): error TS1005: ';' expected.
tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,6): error TS2457: Type alias name cannot be 'void'.
tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,11): error TS1109: Expression expected.
tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,13): error TS2693: 'I' only refers to a type, but is being used as a value here.
tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(7,6): error TS2457: Type alias name cannot be 'object'.
@@ -27,7 +27,7 @@ tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(7,6): error
~~~~
!!! error TS2304: Cannot find name 'type'.
~~~~
!!! error TS1005: ';' expected.
!!! error TS2457: Type alias name cannot be 'void'.
~
!!! error TS1109: Expression expected.
~
@@ -15,7 +15,7 @@ tests/cases/compiler/reservedWords2.ts(5,9): error TS2567: Enum declarations can
tests/cases/compiler/reservedWords2.ts(5,10): error TS1359: Identifier expected. 'throw' is a reserved word that cannot be used here.
tests/cases/compiler/reservedWords2.ts(5,18): error TS1005: '=>' expected.
tests/cases/compiler/reservedWords2.ts(6,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
tests/cases/compiler/reservedWords2.ts(6,8): error TS1005: ';' expected.
tests/cases/compiler/reservedWords2.ts(6,8): error TS2819: Namespace name cannot be 'void'.
tests/cases/compiler/reservedWords2.ts(7,11): error TS2300: Duplicate identifier '(Missing)'.
tests/cases/compiler/reservedWords2.ts(7,11): error TS1005: ':' expected.
tests/cases/compiler/reservedWords2.ts(7,19): error TS2300: Duplicate identifier '(Missing)'.
@@ -77,7 +77,7 @@ tests/cases/compiler/reservedWords2.ts(12,17): error TS1138: Parameter declarati
~~~~~~
!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
~~~~
!!! error TS1005: ';' expected.
!!! error TS2819: Namespace name cannot be 'void'.
var {while, return} = { while: 1, return: 2 };
!!! error TS2300: Duplicate identifier '(Missing)'.
@@ -1,32 +1,26 @@
tests/cases/conformance/es6/templates/templateStringInModuleName.ts(1,1): error TS2304: Cannot find name 'declare'.
tests/cases/conformance/es6/templates/templateStringInModuleName.ts(1,9): error TS1005: ';' expected.
tests/cases/conformance/es6/templates/templateStringInModuleName.ts(1,9): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
tests/cases/conformance/es6/templates/templateStringInModuleName.ts(1,21): error TS1005: ';' expected.
tests/cases/conformance/es6/templates/templateStringInModuleName.ts(1,16): error TS1443: Module declaration names may only use ' or " quoted strings.
tests/cases/conformance/es6/templates/templateStringInModuleName.ts(4,1): error TS2304: Cannot find name 'declare'.
tests/cases/conformance/es6/templates/templateStringInModuleName.ts(4,9): error TS1005: ';' expected.
tests/cases/conformance/es6/templates/templateStringInModuleName.ts(4,9): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
tests/cases/conformance/es6/templates/templateStringInModuleName.ts(4,24): error TS1005: ';' expected.
tests/cases/conformance/es6/templates/templateStringInModuleName.ts(4,16): error TS1443: Module declaration names may only use ' or " quoted strings.
==== tests/cases/conformance/es6/templates/templateStringInModuleName.ts (8 errors) ====
==== tests/cases/conformance/es6/templates/templateStringInModuleName.ts (6 errors) ====
declare module `M1` {
~~~~~~~
!!! error TS2304: Cannot find name 'declare'.
~~~~~~
!!! error TS1005: ';' expected.
~~~~~~
!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
~
!!! error TS1005: ';' expected.
~~~~
!!! error TS1443: Module declaration names may only use ' or " quoted strings.
}
declare module `M${2}` {
~~~~~~~
!!! error TS2304: Cannot find name 'declare'.
~~~~~~
!!! error TS1005: ';' expected.
~~~~~~
!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
~
!!! error TS1005: ';' expected.
~~~~~~~
!!! error TS1443: Module declaration names may only use ' or " quoted strings.
}
@@ -1,32 +1,26 @@
tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts(1,1): error TS2304: Cannot find name 'declare'.
tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts(1,9): error TS1005: ';' expected.
tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts(1,9): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts(1,21): error TS1005: ';' expected.
tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts(1,16): error TS1443: Module declaration names may only use ' or " quoted strings.
tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts(4,1): error TS2304: Cannot find name 'declare'.
tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts(4,9): error TS1005: ';' expected.
tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts(4,9): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts(4,24): error TS1005: ';' expected.
tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts(4,16): error TS1443: Module declaration names may only use ' or " quoted strings.
==== tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts (8 errors) ====
==== tests/cases/conformance/es6/templates/templateStringInModuleNameES6.ts (6 errors) ====
declare module `M1` {
~~~~~~~
!!! error TS2304: Cannot find name 'declare'.
~~~~~~
!!! error TS1005: ';' expected.
~~~~~~
!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
~
!!! error TS1005: ';' expected.
~~~~
!!! error TS1443: Module declaration names may only use ' or " quoted strings.
}
declare module `M${2}` {
~~~~~~~
!!! error TS2304: Cannot find name 'declare'.
~~~~~~
!!! error TS1005: ';' expected.
~~~~~~
!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
~
!!! error TS1005: ';' expected.
~~~~~~~
!!! error TS1443: Module declaration names may only use ' or " quoted strings.
}
@@ -86,8 +86,8 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(172,37): e
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(172,38): error TS1109: Expression expected.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(172,39): error TS1005: ';' expected.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(172,40): error TS1128: Declaration or statement expected.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(172,42): error TS1434: Unexpected keyword or identifier.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(172,42): error TS2693: 'number' only refers to a type, but is being used as a value here.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(172,49): error TS1005: ';' expected.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(175,23): error TS2730: An arrow function cannot have a 'this' parameter.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(176,16): error TS2730: An arrow function cannot have a 'this' parameter.
tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(177,19): error TS2730: An arrow function cannot have a 'this' parameter.
@@ -422,9 +422,9 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(178,22): e
~
!!! error TS1128: Declaration or statement expected.
~~~~~~
!!! error TS1434: Unexpected keyword or identifier.
~~~~~~
!!! error TS2693: 'number' only refers to a type, but is being used as a value here.
~
!!! error TS1005: ';' expected.
// can't name parameters 'this' in a lambda.
c.explicitProperty = (this, m) => m + this.n;
@@ -1,7 +1,7 @@
file.ts(1,3): error TS1005: ';' expected.
file.ts(1,1): error TS1434: Unexpected keyword or identifier.
==== file.ts (1 errors) ====
a b
~
!!! error TS1005: ';' expected.
~
!!! error TS1434: Unexpected keyword or identifier.
@@ -1,7 +1,7 @@
file.ts(1,3): error TS1005: ';' expected.
file.ts(1,1): error TS1434: Unexpected keyword or identifier.
==== file.ts (1 errors) ====
a b
~
!!! error TS1005: ';' expected.
~
!!! error TS1434: Unexpected keyword or identifier.
@@ -18,9 +18,9 @@ tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(45,2): erro
tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,32): error TS2749: 'numOrStr' refers to a value, but is being used as a type here. Did you mean 'typeof numOrStr'?
tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,41): error TS1005: ')' expected.
tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,41): error TS2304: Cannot find name 'is'.
tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,44): error TS1005: ';' expected.
tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,44): error TS1434: Unexpected keyword or identifier.
tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,44): error TS2693: 'string' only refers to a type, but is being used as a value here.
tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,50): error TS1005: ';' expected.
tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,50): error TS1128: Declaration or statement expected.
==== tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts (18 errors) ====
@@ -111,11 +111,11 @@ tests/cases/conformance/expressions/typeAssertions/typeAssertions.ts(48,50): err
~~
!!! error TS2304: Cannot find name 'is'.
~~~~~~
!!! error TS1005: ';' expected.
!!! error TS1434: Unexpected keyword or identifier.
~~~~~~
!!! error TS2693: 'string' only refers to a type, but is being used as a value here.
~
!!! error TS1005: ';' expected.
!!! error TS1128: Declaration or statement expected.
}
@@ -2,8 +2,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(1,7):
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(14,5): error TS2322: Type 'string' is not assignable to type 'boolean'.
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(17,55): error TS2749: 'x' refers to a value, but is being used as a type here. Did you mean 'typeof x'?
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(17,57): error TS1144: '{' or ';' expected.
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(17,60): error TS1005: ';' expected.
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(17,62): error TS1005: ';' expected.
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(17,60): error TS1434: Unexpected keyword or identifier.
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(21,33): error TS2749: 'x' refers to a value, but is being used as a type here. Did you mean 'typeof x'?
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(25,33): error TS1225: Cannot find parameter 'x'.
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(29,10): error TS2391: Function implementation is missing or not immediately following the declaration.
@@ -37,8 +36,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(96,18)
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(96,21): error TS1005: ',' expected.
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(97,20): error TS2749: 'b' refers to a value, but is being used as a type here. Did you mean 'typeof b'?
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(97,22): error TS1144: '{' or ';' expected.
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(97,25): error TS1005: ';' expected.
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(97,27): error TS1005: ';' expected.
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(97,25): error TS1434: Unexpected keyword or identifier.
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(103,25): error TS1228: A type predicate is only allowed in return type position for functions and methods.
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(104,9): error TS2322: Type 'boolean' is not assignable to type 'D'.
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(104,9): error TS2409: Return type of constructor signature must be assignable to the instance type of the class.
@@ -48,7 +46,6 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(110,9)
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(115,18): error TS1228: A type predicate is only allowed in return type position for functions and methods.
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(119,22): error TS2304: Cannot find name 'p1'.
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(119,25): error TS1005: ';' expected.
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(119,28): error TS1005: ';' expected.
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(120,1): error TS1128: Declaration or statement expected.
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(123,20): error TS1229: A type predicate cannot reference a rest parameter.
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(128,34): error TS1230: A type predicate cannot reference element 'p1' in a binding pattern.
@@ -68,7 +65,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(166,45
tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(166,54): error TS2344: Type 'number' does not satisfy the constraint 'Foo'.
==== tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts (56 errors) ====
==== tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts (53 errors) ====
class A {
~
!!! error TS2300: Duplicate identifier 'A'.
@@ -95,9 +92,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(166,54
~~
!!! error TS1144: '{' or ';' expected.
~
!!! error TS1005: ';' expected.
~
!!! error TS1005: ';' expected.
!!! error TS1434: Unexpected keyword or identifier.
return true;
}
@@ -242,9 +237,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(166,54
~~
!!! error TS1144: '{' or ';' expected.
~
!!! error TS1005: ';' expected.
~
!!! error TS1005: ';' expected.
!!! error TS1434: Unexpected keyword or identifier.
return true;
};
@@ -284,8 +277,6 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(166,54
~~
!!! error TS2304: Cannot find name 'p1'.
~~
!!! error TS1005: ';' expected.
~
!!! error TS1005: ';' expected.
}
~
@@ -0,0 +1,81 @@
// @noEmit: true
// @noTypesAndSymbols: true
async function myAsyncFunction1() {}
asynd function myAsyncFunction2() {}
sasync function myAsyncFunction3() {}
// Arrow functions don't (yet?) parse as nicely as standalone functions.
// Eventually it would be good to get them the same "did you mean" for typos such as "asyncd".
const myAsyncArrow1 = async () => 3;
const myAsyncArrow2 = asyncd () => 3;
class MyClass1 {}
clasd MyClass2 {}
classs MyClass3 {}
const myConst1 = 1;
consd myConst2 = 1;
constd myConst3 = 1;
declare const myDeclareConst1: 1;
declared const myDeclareConst2: 1;
declare constd myDeclareConst3: 1;
declared constd myDeclareConst4: 1;
declareconst myDeclareConst5;
function myFunction1() { }
functiond myFunction2() { }
function function() { }
functionMyFunction;
interface myInterface1 { }
interfaced myInterface2 { }
interface interface { }
interface { }
interface void { }
interfaceMyInterface { }
let let = 1;
let let1 = 1;
letd let2 = 1;
letMyLet;
type type;
type type1 = {};
type type2 = type;
type type3 = {};
typed type4 = {}
typed type5 = type;
typeMyType;
var myVar1 = 1;
vard myVar2 = 1;
varMyVar;
class NoSemicolonClassA {
['a'] = 0
{}
}
class NoSemicolonClassB {
['a'] = 0
{}
}
class NoSemicolonClassC {
['a'] = 0;
{}
}
class NoSemicolonClassD {
['a'] = 0
['b']() {}
}
class NoSemicolonClassE {
['a'] = 0
['b']() {
c: true
}
}