diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a28aab5d69b..6bb7635843d 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4872,47 +4872,101 @@ module ts { var hasOverloads = false; var bodyDeclaration: FunctionDeclaration; var lastSeenNonAmbientDeclaration: FunctionDeclaration; + var previousDeclaration: FunctionDeclaration; + var declarations = symbol.declarations; var isConstructor = (symbol.flags & SymbolFlags.Constructor) !== 0; + + function reportImplementationExpectedError(node: FunctionDeclaration): void { + var seen = false; + var subsequentNode = forEachChild(node.parent, c => { + if (seen) { + return c; + } + else { + seen = c === node; + } + }); + if (subsequentNode) { + if (subsequentNode.kind === node.kind) { + var errorNode: Node = (subsequentNode).name || subsequentNode; + if (node.name && (subsequentNode).name && node.name.text === (subsequentNode).name.text) { + // the only situation when this is possible (same kind\same name but different symbol) - mixed static and instance class members + Debug.assert(node.kind === SyntaxKind.Method); + Debug.assert((node.flags & NodeFlags.Static) !== (subsequentNode.flags & NodeFlags.Static)); + var diagnostic = node.flags & NodeFlags.Static ? Diagnostics.Function_overload_must_be_static : Diagnostics.Function_overload_must_not_be_static; + error(errorNode, diagnostic); + return; + } + else if ((subsequentNode).body) { + error(errorNode, Diagnostics.Function_implementation_name_must_be_0, identifierToString(node.name)); + return; + } + } + } + var errorNode: Node = node.name || node; + if (isConstructor) { + error(errorNode, Diagnostics.Constructor_implementation_is_missing); + } + else { + error(errorNode, Diagnostics.Function_implementation_is_missing); + } + } + + // when checking exported function declarations across modules check only duplicate implementations + // names and consistensy of modifiers are verified when we check local symbol + var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & SymbolFlags.Module; for (var i = 0; i < declarations.length; i++) { var node = declarations[i]; + var inAmbientContext = isInAmbientContext(node); + var inAmbientContextOrInterface = node.parent.kind === SyntaxKind.InterfaceDeclaration || node.parent.kind === SyntaxKind.TypeLiteral || inAmbientContext; + if (inAmbientContextOrInterface) { + // check if declarations are consecutive only if they are non-ambient + // 1. ambient declarations can be interleaved + // i.e. this is legal + // declare function foo(); + // declare function bar(); + // declare function foo(); + // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one + previousDeclaration = undefined; + } + if (node.kind === SyntaxKind.FunctionDeclaration || node.kind === SyntaxKind.Method || node.kind === SyntaxKind.Constructor) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; - var inAmbientContext = isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === SyntaxKind.InterfaceDeclaration || node.parent.kind === SyntaxKind.TypeLiteral || inAmbientContext; - if (!inAmbientContextOrInterface) { - lastSeenNonAmbientDeclaration = node; + if (node.body && bodyDeclaration) { + if (isConstructor) { + error(node, Diagnostics.Multiple_constructor_implementations_are_not_allowed); + } + else { + error(node, Diagnostics.Duplicate_function_implementation); + } + } + else if (!isExportSymbolInsideModule && previousDeclaration && previousDeclaration.parent === node.parent && previousDeclaration.end !== node.pos) { + reportImplementationExpectedError(previousDeclaration); } if (node.body) { - if (bodyDeclaration) { - if (isConstructor) { - error(node, Diagnostics.Multiple_constructor_implementations_are_not_allowed); - } - else { - error(node, Diagnostics.Duplicate_function_implementation); - } - } - else { + if (!bodyDeclaration) { bodyDeclaration = node; } } else { hasOverloads = true; } + + previousDeclaration = node; + + if (!inAmbientContextOrInterface) { + lastSeenNonAmbientDeclaration = node; + } } } - if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body) { - if (isConstructor) { - error(lastSeenNonAmbientDeclaration, Diagnostics.Constructor_implementation_expected); - } - else { - error(lastSeenNonAmbientDeclaration, Diagnostics.Function_implementation_expected); - } + if (!isExportSymbolInsideModule && lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body) { + reportImplementationExpectedError(lastSeenNonAmbientDeclaration); } if (hasOverloads) { @@ -4985,7 +5039,7 @@ module ts { } }); - var commonDeclarationSpace = exportedDeclarationSpaces & nonExportedDeclarationSpaces + var commonDeclarationSpace = exportedDeclarationSpaces & nonExportedDeclarationSpaces; if (commonDeclarationSpace) { // declaration spaces for exported and non-exported declarations intersect diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 080bee226de..3301cd8da47 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -158,9 +158,12 @@ module ts { Duplicate_number_index_signature: { code: 2233, category: DiagnosticCategory.Error, key: "Duplicate number index signature." }, All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2234, category: DiagnosticCategory.Error, key: "All declarations of an interface must have identical type parameters." }, Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: { code: 2235, category: DiagnosticCategory.Error, key: "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter." }, - Constructor_implementation_expected: { code: 2240, category: DiagnosticCategory.Error, key: "Constructor implementation expected." }, + Function_implementation_name_must_be_0: { code: 2239, category: DiagnosticCategory.Error, key: "Function implementation name must be '{0}'." }, + Constructor_implementation_is_missing: { code: 2240, category: DiagnosticCategory.Error, key: "Constructor implementation is missing." }, An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2245, category: DiagnosticCategory.Error, key: "An export assignment cannot be used in a module with other exported elements." }, A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2246, category: DiagnosticCategory.Error, key: "A parameter property is only allowed in a constructor implementation." }, + Function_overload_must_be_static: { code: 2247, category: DiagnosticCategory.Error, key: "Function overload must be static." }, + Function_overload_must_not_be_static: { code: 2248, category: DiagnosticCategory.Error, key: "Function overload must not be static." }, Circular_definition_of_import_alias_0: { code: 3000, category: DiagnosticCategory.Error, key: "Circular definition of import alias '{0}'." }, Cannot_find_name_0: { code: 3001, category: DiagnosticCategory.Error, key: "Cannot find name '{0}'." }, Module_0_has_no_exported_member_1: { code: 3002, category: DiagnosticCategory.Error, key: "Module '{0}' has no exported member '{1}'." }, @@ -276,7 +279,7 @@ module ts { Types_of_parameters_0_and_1_are_incompatible_Colon: { code: -9999999, category: DiagnosticCategory.Error, key: "Types of parameters '{0}' and '{1}' are incompatible:" }, Unknown_identifier_0: { code: -9999999, category: DiagnosticCategory.Error, key: "Unknown identifier '{0}'." }, Property_0_is_inaccessible: { code: -9999999, category: DiagnosticCategory.Error, key: "Property '{0}' is inaccessible." }, - Function_implementation_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Function implementation expected." }, + Function_implementation_is_missing: { code: -9999999, category: DiagnosticCategory.Error, key: "Function implementation is missing." }, Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: -9999999, category: DiagnosticCategory.Error, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: -9999999, category: DiagnosticCategory.Error, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: -9999999, category: DiagnosticCategory.Error, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 6e6efa9bbab..f9fdf66639e 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -623,8 +623,12 @@ "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter.": { "category": "Error", "code": 2235 - }, - "Constructor implementation expected.": { + }, + "Function implementation name must be '{0}'.": { + "category": "Error", + "code": 2239 + }, + "Constructor implementation is missing.": { "category": "Error", "code": 2240 }, @@ -636,6 +640,14 @@ "category": "Error", "code": 2246 }, + "Function overload must be static.": { + "category": "Error", + "code": 2247 + }, + "Function overload must not be static.": { + "category": "Error", + "code": 2248 + }, "Circular definition of import alias '{0}'.": { "category": "Error", "code": 3000 @@ -900,7 +912,6 @@ "category": "Error", "code": 7020 }, - "Variable declaration list cannot be empty.": { "category": "Error", "code": -9999999 @@ -1121,7 +1132,7 @@ "category": "Error", "code": -9999999 }, - "Function implementation expected.": { + "Function implementation is missing.": { "category": "Error", "code": -9999999 }, diff --git a/tests/baselines/reference/ClassDeclaration10.errors.txt b/tests/baselines/reference/ClassDeclaration10.errors.txt index e6da67e4f2a..b14c22d1b63 100644 --- a/tests/baselines/reference/ClassDeclaration10.errors.txt +++ b/tests/baselines/reference/ClassDeclaration10.errors.txt @@ -2,8 +2,8 @@ class C { constructor(); ~~~~~~~~~~~~~~ -!!! Constructor implementation expected. +!!! Constructor implementation is missing. foo(); - ~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration11.errors.txt b/tests/baselines/reference/ClassDeclaration11.errors.txt index dd121f25ad9..b92a04cec6c 100644 --- a/tests/baselines/reference/ClassDeclaration11.errors.txt +++ b/tests/baselines/reference/ClassDeclaration11.errors.txt @@ -2,6 +2,6 @@ class C { constructor(); ~~~~~~~~~~~~~~ -!!! Constructor implementation expected. +!!! Constructor implementation is missing. foo() { } } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration13.errors.txt b/tests/baselines/reference/ClassDeclaration13.errors.txt index d4794f73042..406d41c20de 100644 --- a/tests/baselines/reference/ClassDeclaration13.errors.txt +++ b/tests/baselines/reference/ClassDeclaration13.errors.txt @@ -1,7 +1,7 @@ ==== tests/cases/compiler/ClassDeclaration13.ts (1 errors) ==== class C { foo(); - ~~~~~~ -!!! Function implementation expected. bar() { } + ~~~ +!!! Function implementation name must be 'foo'. } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration14.errors.txt b/tests/baselines/reference/ClassDeclaration14.errors.txt index afac27ca995..be56741d656 100644 --- a/tests/baselines/reference/ClassDeclaration14.errors.txt +++ b/tests/baselines/reference/ClassDeclaration14.errors.txt @@ -1,9 +1,9 @@ ==== tests/cases/compiler/ClassDeclaration14.ts (2 errors) ==== class C { foo(); - ~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. constructor(); ~~~~~~~~~~~~~~ -!!! Constructor implementation expected. +!!! Constructor implementation is missing. } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration15.errors.txt b/tests/baselines/reference/ClassDeclaration15.errors.txt index e2ae4582beb..de98a14880d 100644 --- a/tests/baselines/reference/ClassDeclaration15.errors.txt +++ b/tests/baselines/reference/ClassDeclaration15.errors.txt @@ -1,7 +1,7 @@ ==== tests/cases/compiler/ClassDeclaration15.ts (1 errors) ==== class C { foo(); - ~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. constructor() { } } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration21.errors.txt b/tests/baselines/reference/ClassDeclaration21.errors.txt index 1afcbb32653..8b49f1df543 100644 --- a/tests/baselines/reference/ClassDeclaration21.errors.txt +++ b/tests/baselines/reference/ClassDeclaration21.errors.txt @@ -1,7 +1,7 @@ ==== tests/cases/compiler/ClassDeclaration21.ts (1 errors) ==== class C { 0(); - ~~~~ -!!! Function implementation expected. 1() { } + ~ +!!! Function implementation name must be '0'. } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration22.errors.txt b/tests/baselines/reference/ClassDeclaration22.errors.txt index 6336ee0f6aa..34832185e12 100644 --- a/tests/baselines/reference/ClassDeclaration22.errors.txt +++ b/tests/baselines/reference/ClassDeclaration22.errors.txt @@ -1,7 +1,7 @@ ==== tests/cases/compiler/ClassDeclaration22.ts (1 errors) ==== class C { "foo"(); - ~~~~~~~~ -!!! Function implementation expected. "bar"() { } + ~~~~~ +!!! Function implementation name must be '"foo"'. } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration25.errors.txt b/tests/baselines/reference/ClassDeclaration25.errors.txt index cd247fc491d..2d86bd80fa6 100644 --- a/tests/baselines/reference/ClassDeclaration25.errors.txt +++ b/tests/baselines/reference/ClassDeclaration25.errors.txt @@ -5,10 +5,10 @@ } class List implements IList { data(): U; - ~~~~~~~~~~ -!!! Function implementation expected. + ~~~~ +!!! Function implementation is missing. next(): string; - ~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~~ +!!! Function implementation is missing. } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration8.errors.txt b/tests/baselines/reference/ClassDeclaration8.errors.txt index a98453f35df..ebf1cadd764 100644 --- a/tests/baselines/reference/ClassDeclaration8.errors.txt +++ b/tests/baselines/reference/ClassDeclaration8.errors.txt @@ -2,5 +2,5 @@ class C { constructor(); ~~~~~~~~~~~~~~ -!!! Constructor implementation expected. +!!! Constructor implementation is missing. } \ No newline at end of file diff --git a/tests/baselines/reference/ClassDeclaration9.errors.txt b/tests/baselines/reference/ClassDeclaration9.errors.txt index 7ae11739476..f8d51d26b4b 100644 --- a/tests/baselines/reference/ClassDeclaration9.errors.txt +++ b/tests/baselines/reference/ClassDeclaration9.errors.txt @@ -1,6 +1,6 @@ ==== tests/cases/compiler/ClassDeclaration9.ts (1 errors) ==== class C { foo(); - ~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration3.errors.txt b/tests/baselines/reference/FunctionDeclaration3.errors.txt index a0f2601c3a8..c5a553ed9a4 100644 --- a/tests/baselines/reference/FunctionDeclaration3.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration3.errors.txt @@ -1,4 +1,4 @@ ==== tests/cases/compiler/FunctionDeclaration3.ts (1 errors) ==== function foo(); - ~~~~~~~~~~~~~~~ -!!! Function implementation expected. \ No newline at end of file + ~~~ +!!! Function implementation is missing. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration4.errors.txt b/tests/baselines/reference/FunctionDeclaration4.errors.txt index 1c03570a8fb..da15ad0efa4 100644 --- a/tests/baselines/reference/FunctionDeclaration4.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration4.errors.txt @@ -1,5 +1,5 @@ ==== tests/cases/compiler/FunctionDeclaration4.ts (1 errors) ==== function foo(); - ~~~~~~~~~~~~~~~ -!!! Function implementation expected. - function bar() { } \ No newline at end of file + function bar() { } + ~~~ +!!! Function implementation name must be 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration6.errors.txt b/tests/baselines/reference/FunctionDeclaration6.errors.txt index 056ad27c3fd..c7e039cac13 100644 --- a/tests/baselines/reference/FunctionDeclaration6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration6.errors.txt @@ -1,7 +1,7 @@ ==== tests/cases/compiler/FunctionDeclaration6.ts (1 errors) ==== { function foo(); - ~~~~~~~~~~~~~~~ -!!! Function implementation expected. function bar() { } + ~~~ +!!! Function implementation name must be 'foo'. } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration7.errors.txt b/tests/baselines/reference/FunctionDeclaration7.errors.txt index cf6ee375de5..8c7ae6f8bf3 100644 --- a/tests/baselines/reference/FunctionDeclaration7.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration7.errors.txt @@ -1,6 +1,6 @@ ==== tests/cases/compiler/FunctionDeclaration7.ts (1 errors) ==== module M { function foo(); - ~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt index 2abf97a25de..1a4eaf30392 100644 --- a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt +++ b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt @@ -1,7 +1,7 @@ ==== tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts (3 errors) ==== function foo(x: { id: number; name?: string; }): void; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. foo({ id: 1234 }); // Ok foo({ id: 1234, name: "hello" }); // Ok foo({ id: 1234, name: false }); // Error, name of wrong type diff --git a/tests/baselines/reference/callOverloads1.errors.txt b/tests/baselines/reference/callOverloads1.errors.txt index 47a6b6c8e06..06aa8e6eeb7 100644 --- a/tests/baselines/reference/callOverloads1.errors.txt +++ b/tests/baselines/reference/callOverloads1.errors.txt @@ -8,8 +8,8 @@ } function Foo(); // error - ~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. ~~~ !!! Duplicate identifier 'Foo'. function F1(s:string); diff --git a/tests/baselines/reference/callOverloads2.errors.txt b/tests/baselines/reference/callOverloads2.errors.txt index 8d99dba63d6..1649729048c 100644 --- a/tests/baselines/reference/callOverloads2.errors.txt +++ b/tests/baselines/reference/callOverloads2.errors.txt @@ -10,19 +10,19 @@ } function Foo(); - ~~~~~~~~~~~~~~~ -!!! Function implementation expected. ~~~ !!! Duplicate identifier 'Foo'. function F1(s:string) {return s;} + ~~ +!!! Function implementation name must be 'Foo'. function F1(a:any) { return a;} // error - duplicate identifier ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! Duplicate function implementation. function Goo(s:string); // error - no implementation - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. declare function Gar(s:String); // expect no error diff --git a/tests/baselines/reference/callOverloads3.errors.txt b/tests/baselines/reference/callOverloads3.errors.txt index a2e4050579f..eef63a64807 100644 --- a/tests/baselines/reference/callOverloads3.errors.txt +++ b/tests/baselines/reference/callOverloads3.errors.txt @@ -4,8 +4,8 @@ ~~~ !!! Cannot find name 'Foo'. function Foo(s:string):Foo; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. ~~~ !!! Cannot find name 'Foo'. class Foo { diff --git a/tests/baselines/reference/callOverloads4.errors.txt b/tests/baselines/reference/callOverloads4.errors.txt index 36c0b97955e..053305c3657 100644 --- a/tests/baselines/reference/callOverloads4.errors.txt +++ b/tests/baselines/reference/callOverloads4.errors.txt @@ -4,8 +4,8 @@ ~~~ !!! Cannot find name 'Foo'. function Foo(s:string):Foo; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. ~~~ !!! Cannot find name 'Foo'. class Foo { diff --git a/tests/baselines/reference/callOverloads5.errors.txt b/tests/baselines/reference/callOverloads5.errors.txt index ba667881530..e7ccb6c5a08 100644 --- a/tests/baselines/reference/callOverloads5.errors.txt +++ b/tests/baselines/reference/callOverloads5.errors.txt @@ -3,8 +3,8 @@ ~~~ !!! Cannot find name 'Foo'. function Foo(s:string):Foo; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. ~~~ !!! Cannot find name 'Foo'. class Foo { diff --git a/tests/baselines/reference/classOverloadForFunction2.errors.txt b/tests/baselines/reference/classOverloadForFunction2.errors.txt index d1e2135b94e..be4ce08a9e5 100644 --- a/tests/baselines/reference/classOverloadForFunction2.errors.txt +++ b/tests/baselines/reference/classOverloadForFunction2.errors.txt @@ -1,7 +1,7 @@ ==== tests/cases/compiler/classOverloadForFunction2.ts (2 errors) ==== function bar(): string; - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. class bar {} ~~~ !!! Duplicate identifier 'bar'. \ No newline at end of file diff --git a/tests/baselines/reference/classWithOverloadImplementationOfWrongName.errors.txt b/tests/baselines/reference/classWithOverloadImplementationOfWrongName.errors.txt index e939db8e418..1d2d5bb0c70 100644 --- a/tests/baselines/reference/classWithOverloadImplementationOfWrongName.errors.txt +++ b/tests/baselines/reference/classWithOverloadImplementationOfWrongName.errors.txt @@ -2,7 +2,7 @@ class C { foo(): string; foo(x): number; - ~~~~~~~~~~~~~~~ -!!! Function implementation expected. bar(x): any { } + ~~~ +!!! Function implementation name must be 'foo'. } \ No newline at end of file diff --git a/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.errors.txt b/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.errors.txt index 5c233b6c43c..08aaa1239eb 100644 --- a/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.errors.txt +++ b/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.errors.txt @@ -1,8 +1,10 @@ -==== tests/cases/compiler/classWithOverloadImplementationOfWrongName2.ts (1 errors) ==== +==== tests/cases/compiler/classWithOverloadImplementationOfWrongName2.ts (2 errors) ==== class C { foo(): string; bar(x): any { } + ~~~ +!!! Function implementation name must be 'foo'. foo(x): number; - ~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. } \ No newline at end of file diff --git a/tests/baselines/reference/crashOnMethodSignatures.errors.txt b/tests/baselines/reference/crashOnMethodSignatures.errors.txt index ceba3908f43..f7b02a2bb4d 100644 --- a/tests/baselines/reference/crashOnMethodSignatures.errors.txt +++ b/tests/baselines/reference/crashOnMethodSignatures.errors.txt @@ -1,7 +1,7 @@ ==== tests/cases/compiler/crashOnMethodSignatures.ts (1 errors) ==== class A { a(completed: () => any): void; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~ +!!! Function implementation is missing. } \ No newline at end of file diff --git a/tests/baselines/reference/dottedModuleName.errors.txt b/tests/baselines/reference/dottedModuleName.errors.txt index 5a207c96bd0..5a2c9753257 100644 --- a/tests/baselines/reference/dottedModuleName.errors.txt +++ b/tests/baselines/reference/dottedModuleName.errors.txt @@ -4,8 +4,8 @@ export function f(x:number)=>2*x; ~~ !!! Block or ';' expected. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~ +!!! Function implementation is missing. ~ !!! Cannot find name 'x'. export module X.Y.Z { diff --git a/tests/baselines/reference/externModule.errors.txt b/tests/baselines/reference/externModule.errors.txt index afc072d0de3..f7e4795e6b8 100644 --- a/tests/baselines/reference/externModule.errors.txt +++ b/tests/baselines/reference/externModule.errors.txt @@ -14,11 +14,11 @@ ~~~~~ !!! Cannot compile external modules unless the '--module' flag is provided. public getDay():number; - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~~~~ +!!! Function implementation is missing. public getXDate():number; - ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~~~~~~ +!!! Function implementation is missing. // etc. // Called as a function @@ -34,24 +34,23 @@ constructor(value: number); constructor(); ~~~~~~~~~~~~~~ -!!! Constructor implementation expected. +!!! Constructor implementation is missing. static parse(string: string): number; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~~~ +!!! Function implementation is missing. static UTC(year: number, month: number): number; static UTC(year: number, month: number, date: number): number; static UTC(year: number, month: number, date: number, hours: number): number; static UTC(year: number, month: number, date: number, hours: number, minutes: number): number; static UTC(year: number, month: number, date: number, hours: number, minutes: number, seconds: number): number; static UTC(year: number, month: number, date: number, hours: number, minutes: number, seconds: number, - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ +!!! Function implementation is missing. ms: number): number; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. static now(): number; - ~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. } } ~ diff --git a/tests/baselines/reference/functionNameConflicts.errors.txt b/tests/baselines/reference/functionNameConflicts.errors.txt index d71b6dc2e69..0442a51324b 100644 --- a/tests/baselines/reference/functionNameConflicts.errors.txt +++ b/tests/baselines/reference/functionNameConflicts.errors.txt @@ -32,9 +32,9 @@ } function over(); - ~~~~~~~~~~~~~~~~ -!!! Function implementation expected. function overrr() { + ~~~~~~ +!!! Function implementation name must be 'over'. } \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloadErrors.errors.txt b/tests/baselines/reference/functionOverloadErrors.errors.txt index 394607010ec..c2fcff7a943 100644 --- a/tests/baselines/reference/functionOverloadErrors.errors.txt +++ b/tests/baselines/reference/functionOverloadErrors.errors.txt @@ -1,4 +1,4 @@ -==== tests/cases/conformance/functions/functionOverloadErrors.ts (15 errors) ==== +==== tests/cases/conformance/functions/functionOverloadErrors.ts (14 errors) ==== //Function overload signature with initializer function fn1(x = 3); ~~~~~ @@ -86,8 +86,6 @@ //Function overloads with differing export module M { export function fn1(); - ~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. ~~~ !!! Overload signatures must all be exported or not exported. function fn1(n: string); diff --git a/tests/baselines/reference/functionOverloadImplementationOfWrongName.errors.txt b/tests/baselines/reference/functionOverloadImplementationOfWrongName.errors.txt index a948858122f..427595d1e05 100644 --- a/tests/baselines/reference/functionOverloadImplementationOfWrongName.errors.txt +++ b/tests/baselines/reference/functionOverloadImplementationOfWrongName.errors.txt @@ -1,6 +1,6 @@ ==== tests/cases/compiler/functionOverloadImplementationOfWrongName.ts (1 errors) ==== function foo(x); function foo(x, y); - ~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. - function bar() { } \ No newline at end of file + function bar() { } + ~~~ +!!! Function implementation name must be 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloadImplementationOfWrongName2.errors.txt b/tests/baselines/reference/functionOverloadImplementationOfWrongName2.errors.txt index 371d06e6a6c..a5216bebb40 100644 --- a/tests/baselines/reference/functionOverloadImplementationOfWrongName2.errors.txt +++ b/tests/baselines/reference/functionOverloadImplementationOfWrongName2.errors.txt @@ -1,6 +1,8 @@ -==== tests/cases/compiler/functionOverloadImplementationOfWrongName2.ts (1 errors) ==== +==== tests/cases/compiler/functionOverloadImplementationOfWrongName2.ts (2 errors) ==== function foo(x); function bar() { } + ~~~ +!!! Function implementation name must be 'foo'. function foo(x, y); - ~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. \ No newline at end of file + ~~~ +!!! Function implementation is missing. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads1.errors.txt b/tests/baselines/reference/functionOverloads1.errors.txt new file mode 100644 index 00000000000..71532313f44 --- /dev/null +++ b/tests/baselines/reference/functionOverloads1.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/functionOverloads1.ts (1 errors) ==== + function foo(); + ~~~ +!!! Function implementation is missing. + 1+1; + function foo():string { return "a" } \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads3.errors.txt b/tests/baselines/reference/functionOverloads3.errors.txt index 791553cf954..79fca9f342c 100644 --- a/tests/baselines/reference/functionOverloads3.errors.txt +++ b/tests/baselines/reference/functionOverloads3.errors.txt @@ -1,4 +1,4 @@ ==== tests/cases/compiler/functionOverloads3.ts (1 errors) ==== function foo():string; - ~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. \ No newline at end of file + ~~~ +!!! Function implementation is missing. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloadsOutOfOrder.errors.txt b/tests/baselines/reference/functionOverloadsOutOfOrder.errors.txt index 64249e33c23..977d160a45a 100644 --- a/tests/baselines/reference/functionOverloadsOutOfOrder.errors.txt +++ b/tests/baselines/reference/functionOverloadsOutOfOrder.errors.txt @@ -5,8 +5,8 @@ return ns.toString(); } private foo(s: string): string; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. } class e { @@ -15,6 +15,6 @@ } private foo(s: string): string; private foo(n: number): string; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. } \ No newline at end of file diff --git a/tests/baselines/reference/incorrectClassOverloadChain.errors.txt b/tests/baselines/reference/incorrectClassOverloadChain.errors.txt index 6521936b4d8..6c12e650d02 100644 --- a/tests/baselines/reference/incorrectClassOverloadChain.errors.txt +++ b/tests/baselines/reference/incorrectClassOverloadChain.errors.txt @@ -2,7 +2,7 @@ class C { foo(): string; foo(x): number; - ~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. x = 1; } \ No newline at end of file diff --git a/tests/baselines/reference/indexer2A.errors.txt b/tests/baselines/reference/indexer2A.errors.txt index f1b7f6bb23f..25d9145a11f 100644 --- a/tests/baselines/reference/indexer2A.errors.txt +++ b/tests/baselines/reference/indexer2A.errors.txt @@ -3,8 +3,8 @@ class IDirectChildrenMap { // Decided to enforce a semicolon after declarations hasOwnProperty(objectId: number): boolean - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~~~~~~~~~~~~ +!!! Function implementation is missing. [objectId: number]: IHeapObjectProperty[] } var directChildrenMap = {}; \ No newline at end of file diff --git a/tests/baselines/reference/memberFunctionOverloadMixingStaticAndInstance.errors.txt b/tests/baselines/reference/memberFunctionOverloadMixingStaticAndInstance.errors.txt index 08e1eb4e35d..6c1c18c3216 100644 --- a/tests/baselines/reference/memberFunctionOverloadMixingStaticAndInstance.errors.txt +++ b/tests/baselines/reference/memberFunctionOverloadMixingStaticAndInstance.errors.txt @@ -1,36 +1,36 @@ ==== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionOverloadMixingStaticAndInstance.ts (8 errors) ==== class C { foo(); - ~~~~~~ -!!! Function implementation expected. static foo(); // error - ~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. + ~~~ +!!! Function overload must not be static. } class D { static foo(); - ~~~~~~~~~~~~~ -!!! Function implementation expected. foo(); // error - ~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. + ~~~ +!!! Function overload must be static. } class E { foo(x: T); - ~~~~~~~~~~ -!!! Function implementation expected. static foo(x: number); // error - ~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. + ~~~ +!!! Function overload must not be static. } class F { static foo(x: number); - ~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. foo(x: T); // error - ~~~~~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. + ~~~ +!!! Function overload must be static. } \ No newline at end of file diff --git a/tests/baselines/reference/mixingStaticAndInstanceOverloads.errors.txt b/tests/baselines/reference/mixingStaticAndInstanceOverloads.errors.txt index db7dcf5bf6e..300d9d0309f 100644 --- a/tests/baselines/reference/mixingStaticAndInstanceOverloads.errors.txt +++ b/tests/baselines/reference/mixingStaticAndInstanceOverloads.errors.txt @@ -1,35 +1,39 @@ -==== tests/cases/compiler/mixingStaticAndInstanceOverloads.ts (4 errors) ==== +==== tests/cases/compiler/mixingStaticAndInstanceOverloads.ts (6 errors) ==== class C1 { // ERROR foo1(n: number); foo1(s: string); - ~~~~~~~~~~~~~~~~ -!!! Function implementation expected. static foo1(a) { } + ~~~~ +!!! Function overload must not be static. } class C2 { // ERROR static foo2(n: number); static foo2(s: string); - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. foo2(a) { } + ~~~~ +!!! Function overload must be static. } class C3 { // ERROR foo3(n: number); static foo3(s: string); - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~~ +!!! Function overload must not be static. foo3(a) { } + ~~~~ +!!! Function overload must be static. } class C4 { // ERROR static foo4(n: number); foo4(s: string); - ~~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~~ +!!! Function overload must be static. static foo4(a) { } + ~~~~ +!!! Function overload must not be static. } class C5 { // OK diff --git a/tests/baselines/reference/objectTypesWithOptionalProperties2.errors.txt b/tests/baselines/reference/objectTypesWithOptionalProperties2.errors.txt index 96ed619a37a..ee417a928e5 100644 --- a/tests/baselines/reference/objectTypesWithOptionalProperties2.errors.txt +++ b/tests/baselines/reference/objectTypesWithOptionalProperties2.errors.txt @@ -23,8 +23,8 @@ !!! Block or ';' expected. ~ !!! Unexpected token. A constructor, method, accessor, or property was expected. - ~~~ -!!! Function implementation expected. + ~ +!!! Function implementation is missing. } interface I2 { @@ -41,8 +41,8 @@ !!! Block or ';' expected. ~ !!! Unexpected token. A constructor, method, accessor, or property was expected. - ~~~ -!!! Function implementation expected. + ~ +!!! Function implementation is missing. } diff --git a/tests/baselines/reference/overloadModifiersMustAgree.errors.txt b/tests/baselines/reference/overloadModifiersMustAgree.errors.txt index adb535ce385..f2aa56b8e4d 100644 --- a/tests/baselines/reference/overloadModifiersMustAgree.errors.txt +++ b/tests/baselines/reference/overloadModifiersMustAgree.errors.txt @@ -1,4 +1,4 @@ -==== tests/cases/compiler/overloadModifiersMustAgree.ts (5 errors) ==== +==== tests/cases/compiler/overloadModifiersMustAgree.ts (4 errors) ==== class baz { public foo(); ~~~ @@ -10,8 +10,6 @@ ~~~ !!! Overload signatures must all be ambient or non-ambient. export function bar(s: string); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. ~~~ !!! Overload signatures must all be exported or not exported. function bar(s?: string) { } diff --git a/tests/baselines/reference/parserClassDeclaration10.errors.txt b/tests/baselines/reference/parserClassDeclaration10.errors.txt index d210a3b6688..10ef6a300a5 100644 --- a/tests/baselines/reference/parserClassDeclaration10.errors.txt +++ b/tests/baselines/reference/parserClassDeclaration10.errors.txt @@ -2,8 +2,8 @@ class C { constructor(); ~~~~~~~~~~~~~~ -!!! Constructor implementation expected. +!!! Constructor implementation is missing. foo(); - ~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. } \ No newline at end of file diff --git a/tests/baselines/reference/parserClassDeclaration11.errors.txt b/tests/baselines/reference/parserClassDeclaration11.errors.txt index 56636378b7d..061711a137f 100644 --- a/tests/baselines/reference/parserClassDeclaration11.errors.txt +++ b/tests/baselines/reference/parserClassDeclaration11.errors.txt @@ -2,6 +2,6 @@ class C { constructor(); ~~~~~~~~~~~~~~ -!!! Constructor implementation expected. +!!! Constructor implementation is missing. foo() { } } \ No newline at end of file diff --git a/tests/baselines/reference/parserClassDeclaration13.errors.txt b/tests/baselines/reference/parserClassDeclaration13.errors.txt index 4a03b85cd21..18f4c4e16a2 100644 --- a/tests/baselines/reference/parserClassDeclaration13.errors.txt +++ b/tests/baselines/reference/parserClassDeclaration13.errors.txt @@ -1,7 +1,7 @@ ==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration13.ts (1 errors) ==== class C { foo(); - ~~~~~~ -!!! Function implementation expected. bar() { } + ~~~ +!!! Function implementation name must be 'foo'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserClassDeclaration14.errors.txt b/tests/baselines/reference/parserClassDeclaration14.errors.txt index 8c6dd5f5532..dbc94ceb554 100644 --- a/tests/baselines/reference/parserClassDeclaration14.errors.txt +++ b/tests/baselines/reference/parserClassDeclaration14.errors.txt @@ -1,9 +1,9 @@ ==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration14.ts (2 errors) ==== class C { foo(); - ~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. constructor(); ~~~~~~~~~~~~~~ -!!! Constructor implementation expected. +!!! Constructor implementation is missing. } \ No newline at end of file diff --git a/tests/baselines/reference/parserClassDeclaration15.errors.txt b/tests/baselines/reference/parserClassDeclaration15.errors.txt index 2117ee45517..45bc3398e88 100644 --- a/tests/baselines/reference/parserClassDeclaration15.errors.txt +++ b/tests/baselines/reference/parserClassDeclaration15.errors.txt @@ -1,7 +1,7 @@ ==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration15.ts (1 errors) ==== class C { foo(); - ~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. constructor() { } } \ No newline at end of file diff --git a/tests/baselines/reference/parserClassDeclaration21.errors.txt b/tests/baselines/reference/parserClassDeclaration21.errors.txt index 033c739e62a..e74fb243df5 100644 --- a/tests/baselines/reference/parserClassDeclaration21.errors.txt +++ b/tests/baselines/reference/parserClassDeclaration21.errors.txt @@ -1,7 +1,7 @@ ==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration21.ts (1 errors) ==== class C { 0(); - ~~~~ -!!! Function implementation expected. 1() { } + ~ +!!! Function implementation name must be '0'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserClassDeclaration22.errors.txt b/tests/baselines/reference/parserClassDeclaration22.errors.txt index c1d9cc44866..56ead1ff80d 100644 --- a/tests/baselines/reference/parserClassDeclaration22.errors.txt +++ b/tests/baselines/reference/parserClassDeclaration22.errors.txt @@ -1,7 +1,7 @@ ==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration22.ts (1 errors) ==== class C { "foo"(); - ~~~~~~~~ -!!! Function implementation expected. "bar"() { } + ~~~~~ +!!! Function implementation name must be '"foo"'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserClassDeclaration25.errors.txt b/tests/baselines/reference/parserClassDeclaration25.errors.txt index 2e5181ec111..3ac19df284c 100644 --- a/tests/baselines/reference/parserClassDeclaration25.errors.txt +++ b/tests/baselines/reference/parserClassDeclaration25.errors.txt @@ -5,10 +5,10 @@ } class List implements IList { data(): U; - ~~~~~~~~~~ -!!! Function implementation expected. + ~~~~ +!!! Function implementation is missing. next(): string; - ~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~~ +!!! Function implementation is missing. } \ No newline at end of file diff --git a/tests/baselines/reference/parserClassDeclaration8.errors.txt b/tests/baselines/reference/parserClassDeclaration8.errors.txt index 37c3b56cbaf..33aa43d2ab8 100644 --- a/tests/baselines/reference/parserClassDeclaration8.errors.txt +++ b/tests/baselines/reference/parserClassDeclaration8.errors.txt @@ -2,5 +2,5 @@ class C { constructor(); ~~~~~~~~~~~~~~ -!!! Constructor implementation expected. +!!! Constructor implementation is missing. } \ No newline at end of file diff --git a/tests/baselines/reference/parserClassDeclaration9.errors.txt b/tests/baselines/reference/parserClassDeclaration9.errors.txt index 2a197c90d30..f1e6ed44e3a 100644 --- a/tests/baselines/reference/parserClassDeclaration9.errors.txt +++ b/tests/baselines/reference/parserClassDeclaration9.errors.txt @@ -1,6 +1,6 @@ ==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration9.ts (1 errors) ==== class C { foo(); - ~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. } \ No newline at end of file diff --git a/tests/baselines/reference/parserConstructorDeclaration8.errors.txt b/tests/baselines/reference/parserConstructorDeclaration8.errors.txt index 83c602a0b2f..c437a9b9e37 100644 --- a/tests/baselines/reference/parserConstructorDeclaration8.errors.txt +++ b/tests/baselines/reference/parserConstructorDeclaration8.errors.txt @@ -5,5 +5,5 @@ ~ !!! '(' expected. ~~~~~~~~~~~~~~~~~~~ -!!! Constructor implementation expected. +!!! Constructor implementation is missing. } \ No newline at end of file diff --git a/tests/baselines/reference/parserEqualsGreaterThanAfterFunction1.errors.txt b/tests/baselines/reference/parserEqualsGreaterThanAfterFunction1.errors.txt index 7a654084439..7b9a64333b3 100644 --- a/tests/baselines/reference/parserEqualsGreaterThanAfterFunction1.errors.txt +++ b/tests/baselines/reference/parserEqualsGreaterThanAfterFunction1.errors.txt @@ -2,5 +2,5 @@ function => ~~ !!! Identifier expected. - ~~~~~~~~ -!!! Function implementation expected. \ No newline at end of file + +!!! Function implementation is missing. \ No newline at end of file diff --git a/tests/baselines/reference/parserEqualsGreaterThanAfterFunction2.errors.txt b/tests/baselines/reference/parserEqualsGreaterThanAfterFunction2.errors.txt index ef853280daf..c6efbe104db 100644 --- a/tests/baselines/reference/parserEqualsGreaterThanAfterFunction2.errors.txt +++ b/tests/baselines/reference/parserEqualsGreaterThanAfterFunction2.errors.txt @@ -8,5 +8,5 @@ !!! ',' expected. !!! ')' expected. - ~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. \ No newline at end of file + +!!! Function implementation is missing. \ No newline at end of file diff --git a/tests/baselines/reference/parserErrantEqualsGreaterThanAfterFunction1.errors.txt b/tests/baselines/reference/parserErrantEqualsGreaterThanAfterFunction1.errors.txt index b7f3c72f926..d2079dfc867 100644 --- a/tests/baselines/reference/parserErrantEqualsGreaterThanAfterFunction1.errors.txt +++ b/tests/baselines/reference/parserErrantEqualsGreaterThanAfterFunction1.errors.txt @@ -2,5 +2,5 @@ function f() => 4; ~~ !!! Block or ';' expected. - ~~~~~~~~~~~~ -!!! Function implementation expected. \ No newline at end of file + ~ +!!! Function implementation is missing. \ No newline at end of file diff --git a/tests/baselines/reference/parserErrantEqualsGreaterThanAfterFunction2.errors.txt b/tests/baselines/reference/parserErrantEqualsGreaterThanAfterFunction2.errors.txt index 2bcc340e91d..684fd861eb4 100644 --- a/tests/baselines/reference/parserErrantEqualsGreaterThanAfterFunction2.errors.txt +++ b/tests/baselines/reference/parserErrantEqualsGreaterThanAfterFunction2.errors.txt @@ -2,8 +2,8 @@ function f(p: A) => p; ~~ !!! Block or ';' expected. - ~~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~ +!!! Function implementation is missing. ~ !!! Cannot find name 'A'. ~ diff --git a/tests/baselines/reference/parserErrorRecovery_ParameterList6.errors.txt b/tests/baselines/reference/parserErrorRecovery_ParameterList6.errors.txt index ea1b958e11a..0ecdaaffb50 100644 --- a/tests/baselines/reference/parserErrorRecovery_ParameterList6.errors.txt +++ b/tests/baselines/reference/parserErrorRecovery_ParameterList6.errors.txt @@ -5,8 +5,8 @@ !!! Type expected. ~ !!! Identifier expected. - ~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~~~~ +!!! Function implementation is missing. } ~ !!! Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserFunctionDeclaration3.errors.txt b/tests/baselines/reference/parserFunctionDeclaration3.errors.txt index f6274437770..2042033edc1 100644 --- a/tests/baselines/reference/parserFunctionDeclaration3.errors.txt +++ b/tests/baselines/reference/parserFunctionDeclaration3.errors.txt @@ -1,4 +1,4 @@ ==== tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration3.ts (1 errors) ==== function foo(); - ~~~~~~~~~~~~~~~ -!!! Function implementation expected. \ No newline at end of file + ~~~ +!!! Function implementation is missing. \ No newline at end of file diff --git a/tests/baselines/reference/parserFunctionDeclaration4.errors.txt b/tests/baselines/reference/parserFunctionDeclaration4.errors.txt index 57b1f09d9e4..f59ae5df943 100644 --- a/tests/baselines/reference/parserFunctionDeclaration4.errors.txt +++ b/tests/baselines/reference/parserFunctionDeclaration4.errors.txt @@ -1,5 +1,5 @@ ==== tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration4.ts (1 errors) ==== function foo(); - ~~~~~~~~~~~~~~~ -!!! Function implementation expected. - function bar() { } \ No newline at end of file + function bar() { } + ~~~ +!!! Function implementation name must be 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/parserFunctionDeclaration6.errors.txt b/tests/baselines/reference/parserFunctionDeclaration6.errors.txt index 8a9103e9a2e..11758b0a036 100644 --- a/tests/baselines/reference/parserFunctionDeclaration6.errors.txt +++ b/tests/baselines/reference/parserFunctionDeclaration6.errors.txt @@ -1,7 +1,7 @@ ==== tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration6.ts (1 errors) ==== { function foo(); - ~~~~~~~~~~~~~~~ -!!! Function implementation expected. function bar() { } + ~~~ +!!! Function implementation name must be 'foo'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserFunctionDeclaration7.errors.txt b/tests/baselines/reference/parserFunctionDeclaration7.errors.txt index 27f6bdbef6c..40ca2414e8e 100644 --- a/tests/baselines/reference/parserFunctionDeclaration7.errors.txt +++ b/tests/baselines/reference/parserFunctionDeclaration7.errors.txt @@ -1,6 +1,6 @@ ==== tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration7.ts (1 errors) ==== module M { function foo(); - ~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. } \ No newline at end of file diff --git a/tests/baselines/reference/parserModuleDeclaration10.errors.txt b/tests/baselines/reference/parserModuleDeclaration10.errors.txt index 8aab4b40ddc..e0186892703 100644 --- a/tests/baselines/reference/parserModuleDeclaration10.errors.txt +++ b/tests/baselines/reference/parserModuleDeclaration10.errors.txt @@ -1,8 +1,8 @@ ==== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration10.ts (2 errors) ==== function data(): string; - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~~ +!!! Function implementation is missing. function next(): string; - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~~ +!!! Function implementation is missing. \ No newline at end of file diff --git a/tests/baselines/reference/parserSkippedTokens16.errors.txt b/tests/baselines/reference/parserSkippedTokens16.errors.txt index 4f391cef055..9d696386221 100644 --- a/tests/baselines/reference/parserSkippedTokens16.errors.txt +++ b/tests/baselines/reference/parserSkippedTokens16.errors.txt @@ -11,8 +11,8 @@ function Foo () # { } !!! Invalid character. - ~~~~~~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. 4+:5 ~ !!! Expression expected. diff --git a/tests/baselines/reference/staticClassMemberError.errors.txt b/tests/baselines/reference/staticClassMemberError.errors.txt index 6f981054baf..65b2a0b7aa1 100644 --- a/tests/baselines/reference/staticClassMemberError.errors.txt +++ b/tests/baselines/reference/staticClassMemberError.errors.txt @@ -10,8 +10,8 @@ // just want to make sure this one doesn't crash the compiler function Foo(); - ~~~~~~~~~~~~~~~ -!!! Function implementation expected. + ~~~ +!!! Function implementation is missing. class Foo { ~~~ !!! Duplicate identifier 'Foo'.