mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
addressed CR feedback: changed error message
This commit is contained in:
parent
59b1e46102
commit
a62b47eace
@ -4909,7 +4909,7 @@ module ts {
|
||||
error(errorNode, Diagnostics.Constructor_implementation_is_missing);
|
||||
}
|
||||
else {
|
||||
error(errorNode, Diagnostics.Function_implementation_is_missing);
|
||||
error(errorNode, Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -279,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_is_missing: { code: -9999999, category: DiagnosticCategory.Error, key: "Function implementation is missing." },
|
||||
Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: -9999999, category: DiagnosticCategory.Error, key: "Function implementation is missing or not immediately following the declaration." },
|
||||
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}'." },
|
||||
|
||||
@ -1132,7 +1132,7 @@
|
||||
"category": "Error",
|
||||
"code": -9999999
|
||||
},
|
||||
"Function implementation is missing.": {
|
||||
"Function implementation is missing or not immediately following the declaration.": {
|
||||
"category": "Error",
|
||||
"code": -9999999
|
||||
},
|
||||
|
||||
@ -5,5 +5,5 @@
|
||||
!!! Constructor implementation is missing.
|
||||
foo();
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
}
|
||||
@ -2,7 +2,7 @@
|
||||
class C {
|
||||
foo();
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
constructor();
|
||||
~~~~~~~~~~~~~~
|
||||
!!! Constructor implementation is missing.
|
||||
|
||||
@ -2,6 +2,6 @@
|
||||
class C {
|
||||
foo();
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
constructor() { }
|
||||
}
|
||||
@ -6,9 +6,9 @@
|
||||
class List<U> implements IList<U> {
|
||||
data(): U;
|
||||
~~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
next(): string;
|
||||
~~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
}
|
||||
|
||||
@ -2,5 +2,5 @@
|
||||
class C {
|
||||
foo();
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
==== tests/cases/compiler/FunctionDeclaration3.ts (1 errors) ====
|
||||
function foo();
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
@ -2,5 +2,5 @@
|
||||
module M {
|
||||
function foo();
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
==== tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts (3 errors) ====
|
||||
function foo(x: { id: number; name?: string; }): void;
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
foo({ id: 1234 }); // Ok
|
||||
foo({ id: 1234, name: "hello" }); // Ok
|
||||
foo({ id: 1234, name: false }); // Error, name of wrong type
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
|
||||
function Foo(); // error
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
~~~
|
||||
!!! Duplicate identifier 'Foo'.
|
||||
function F1(s:string);
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
function Goo(s:string); // error - no implementation
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
|
||||
declare function Gar(s:String); // expect no error
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
!!! Cannot find name 'Foo'.
|
||||
function Foo(s:string):Foo;
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
~~~
|
||||
!!! Cannot find name 'Foo'.
|
||||
class Foo {
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
!!! Cannot find name 'Foo'.
|
||||
function Foo(s:string):Foo;
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
~~~
|
||||
!!! Cannot find name 'Foo'.
|
||||
class Foo {
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
!!! Cannot find name 'Foo'.
|
||||
function Foo(s:string):Foo;
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
~~~
|
||||
!!! Cannot find name 'Foo'.
|
||||
class Foo {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
==== tests/cases/compiler/classOverloadForFunction2.ts (2 errors) ====
|
||||
function bar(): string;
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
class bar {}
|
||||
~~~
|
||||
!!! Duplicate identifier 'bar'.
|
||||
@ -6,5 +6,5 @@
|
||||
!!! Function implementation name must be 'foo'.
|
||||
foo(x): number;
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
}
|
||||
@ -2,6 +2,6 @@
|
||||
class A {
|
||||
a(completed: () => any): void;
|
||||
~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
~~
|
||||
!!! Block or ';' expected.
|
||||
~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
~
|
||||
!!! Cannot find name 'x'.
|
||||
export module X.Y.Z {
|
||||
|
||||
@ -15,10 +15,10 @@
|
||||
!!! Cannot compile external modules unless the '--module' flag is provided.
|
||||
public getDay():number;
|
||||
~~~~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
public getXDate():number;
|
||||
~~~~~~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
// etc.
|
||||
|
||||
// Called as a function
|
||||
@ -38,7 +38,7 @@
|
||||
|
||||
static parse(string: string): number;
|
||||
~~~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
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;
|
||||
@ -46,11 +46,11 @@
|
||||
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.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
ms: number): number;
|
||||
static now(): number;
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
}
|
||||
}
|
||||
~
|
||||
|
||||
@ -5,4 +5,4 @@
|
||||
!!! Function implementation name must be 'foo'.
|
||||
function foo(x, y);
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
@ -1,6 +1,6 @@
|
||||
==== tests/cases/compiler/functionOverloads1.ts (1 errors) ====
|
||||
function foo();
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
1+1;
|
||||
function foo():string { return "a" }
|
||||
@ -1,4 +1,4 @@
|
||||
==== tests/cases/compiler/functionOverloads3.ts (1 errors) ====
|
||||
function foo():string;
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
@ -6,7 +6,7 @@
|
||||
}
|
||||
private foo(s: string): string;
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
}
|
||||
|
||||
class e {
|
||||
@ -16,5 +16,5 @@
|
||||
private foo(s: string): string;
|
||||
private foo(n: number): string;
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
}
|
||||
@ -3,6 +3,6 @@
|
||||
foo(): string;
|
||||
foo(x): number;
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
x = 1;
|
||||
}
|
||||
@ -4,7 +4,7 @@
|
||||
// Decided to enforce a semicolon after declarations
|
||||
hasOwnProperty(objectId: number): boolean
|
||||
~~~~~~~~~~~~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
[objectId: number]: IHeapObjectProperty[]
|
||||
}
|
||||
var directChildrenMap = <IDirectChildrenMap>{};
|
||||
@ -3,7 +3,7 @@
|
||||
foo();
|
||||
static foo(); // error
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
~~~
|
||||
!!! Function overload must not be static.
|
||||
}
|
||||
@ -12,7 +12,7 @@
|
||||
static foo();
|
||||
foo(); // error
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
~~~
|
||||
!!! Function overload must be static.
|
||||
}
|
||||
@ -21,7 +21,7 @@
|
||||
foo(x: T);
|
||||
static foo(x: number); // error
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
~~~
|
||||
!!! Function overload must not be static.
|
||||
}
|
||||
@ -30,7 +30,7 @@
|
||||
static foo(x: number);
|
||||
foo(x: T); // error
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
~~~
|
||||
!!! Function overload must be static.
|
||||
}
|
||||
@ -24,7 +24,7 @@
|
||||
~
|
||||
!!! Unexpected token. A constructor, method, accessor, or property was expected.
|
||||
~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
}
|
||||
|
||||
interface I2<T> {
|
||||
@ -42,7 +42,7 @@
|
||||
~
|
||||
!!! Unexpected token. A constructor, method, accessor, or property was expected.
|
||||
~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -5,5 +5,5 @@
|
||||
!!! Constructor implementation is missing.
|
||||
foo();
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
}
|
||||
@ -2,7 +2,7 @@
|
||||
class C {
|
||||
foo();
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
constructor();
|
||||
~~~~~~~~~~~~~~
|
||||
!!! Constructor implementation is missing.
|
||||
|
||||
@ -2,6 +2,6 @@
|
||||
class C {
|
||||
foo();
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
constructor() { }
|
||||
}
|
||||
@ -6,9 +6,9 @@
|
||||
class List<U> implements IList<U> {
|
||||
data(): U;
|
||||
~~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
next(): string;
|
||||
~~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
}
|
||||
|
||||
@ -2,5 +2,5 @@
|
||||
class C {
|
||||
foo();
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
}
|
||||
@ -3,4 +3,4 @@
|
||||
~~
|
||||
!!! Identifier expected.
|
||||
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
@ -9,4 +9,4 @@
|
||||
|
||||
!!! ')' expected.
|
||||
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
@ -3,4 +3,4 @@
|
||||
~~
|
||||
!!! Block or ';' expected.
|
||||
~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
@ -3,7 +3,7 @@
|
||||
~~
|
||||
!!! Block or ';' expected.
|
||||
~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
~
|
||||
!!! Cannot find name 'A'.
|
||||
~
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
~
|
||||
!!! Identifier expected.
|
||||
~~~~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
}
|
||||
~
|
||||
!!! Declaration or statement expected.
|
||||
@ -1,4 +1,4 @@
|
||||
==== tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration3.ts (1 errors) ====
|
||||
function foo();
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
@ -2,5 +2,5 @@
|
||||
module M {
|
||||
function foo();
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
}
|
||||
@ -1,8 +1,8 @@
|
||||
==== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration10.ts (2 errors) ====
|
||||
function data(): string;
|
||||
~~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
function next(): string;
|
||||
~~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
!!! Invalid character.
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
4+:5
|
||||
~
|
||||
!!! Expression expected.
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
// just want to make sure this one doesn't crash the compiler
|
||||
function Foo();
|
||||
~~~
|
||||
!!! Function implementation is missing.
|
||||
!!! Function implementation is missing or not immediately following the declaration.
|
||||
class Foo {
|
||||
~~~
|
||||
!!! Duplicate identifier 'Foo'.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user