mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge pull request #30028 from Microsoft/betterOverloadErrors
Better overload incompatibility errors
This commit is contained in:
@@ -24448,7 +24448,10 @@ namespace ts {
|
||||
const bodySignature = getSignatureFromDeclaration(bodyDeclaration);
|
||||
for (const signature of signatures) {
|
||||
if (!isImplementationCompatibleWithOverload(bodySignature, signature)) {
|
||||
error(signature.declaration, Diagnostics.Overload_signature_is_not_compatible_with_function_implementation);
|
||||
addRelatedInfo(
|
||||
error(signature.declaration, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature),
|
||||
createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here)
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1404,7 +1404,7 @@
|
||||
"category": "Error",
|
||||
"code": 2393
|
||||
},
|
||||
"Overload signature is not compatible with function implementation.": {
|
||||
"This overload signature is not compatible with its implementation signature.": {
|
||||
"category": "Error",
|
||||
"code": 2394
|
||||
},
|
||||
@@ -2585,6 +2585,10 @@
|
||||
"category": "Error",
|
||||
"code": 2749
|
||||
},
|
||||
"The implementation signature is declared here.": {
|
||||
"category": "Error",
|
||||
"code": 2750
|
||||
},
|
||||
|
||||
"Import declaration '{0}' is using private name '{1}'.": {
|
||||
"category": "Error",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/anyIdenticalToItself.ts(1,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/compiler/anyIdenticalToItself.ts(1,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
tests/cases/compiler/anyIdenticalToItself.ts(6,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/anyIdenticalToItself.ts(10,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
|
||||
@@ -6,7 +6,8 @@ tests/cases/compiler/anyIdenticalToItself.ts(10,9): error TS1056: Accessors are
|
||||
==== tests/cases/compiler/anyIdenticalToItself.ts (3 errors) ====
|
||||
function foo(x: any);
|
||||
~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/compiler/anyIdenticalToItself.ts:3:10: The implementation signature is declared here.
|
||||
function foo(x: any);
|
||||
function foo(x: any, y: number) { }
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/constructorsWithSpecializedSignatures.ts(18,5): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/compiler/constructorsWithSpecializedSignatures.ts(26,5): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/compiler/constructorsWithSpecializedSignatures.ts(18,5): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
tests/cases/compiler/constructorsWithSpecializedSignatures.ts(26,5): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
|
||||
|
||||
==== tests/cases/compiler/constructorsWithSpecializedSignatures.ts (2 errors) ====
|
||||
@@ -22,7 +22,8 @@ tests/cases/compiler/constructorsWithSpecializedSignatures.ts(26,5): error TS239
|
||||
constructor(x: "hi");
|
||||
constructor(x: "foo");
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/compiler/constructorsWithSpecializedSignatures.ts:20:5: The implementation signature is declared here.
|
||||
constructor(x: number);
|
||||
constructor(x: "hi") { }
|
||||
}
|
||||
@@ -32,7 +33,8 @@ tests/cases/compiler/constructorsWithSpecializedSignatures.ts(26,5): error TS239
|
||||
constructor(x: "hi");
|
||||
constructor(x: "foo");
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/compiler/constructorsWithSpecializedSignatures.ts:28:5: The implementation signature is declared here.
|
||||
constructor(x: string);
|
||||
constructor(x: "hi") { } // error
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
tests/cases/compiler/functionAndInterfaceWithSeparateErrors.ts(1,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/compiler/functionAndInterfaceWithSeparateErrors.ts(1,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
tests/cases/compiler/functionAndInterfaceWithSeparateErrors.ts(6,5): error TS2411: Property 'prop' of type 'number' is not assignable to string index type 'string'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/functionAndInterfaceWithSeparateErrors.ts (2 errors) ====
|
||||
function Foo(s: string);
|
||||
~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/compiler/functionAndInterfaceWithSeparateErrors.ts:2:10: The implementation signature is declared here.
|
||||
function Foo(n: number) { }
|
||||
|
||||
interface Foo {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
tests/cases/conformance/functions/functionOverloadCompatibilityWithVoid01.ts(1,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/conformance/functions/functionOverloadCompatibilityWithVoid01.ts(1,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
|
||||
|
||||
==== tests/cases/conformance/functions/functionOverloadCompatibilityWithVoid01.ts (1 errors) ====
|
||||
function f(x: string): number;
|
||||
~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/conformance/functions/functionOverloadCompatibilityWithVoid01.ts:2:10: The implementation signature is declared here.
|
||||
function f(x: string): void {
|
||||
return;
|
||||
}
|
||||
@@ -5,9 +5,9 @@ tests/cases/conformance/functions/functionOverloadErrors.ts(75,21): error TS2383
|
||||
tests/cases/conformance/functions/functionOverloadErrors.ts(79,14): error TS2383: Overload signatures must all be exported or non-exported.
|
||||
tests/cases/conformance/functions/functionOverloadErrors.ts(85,18): error TS2384: Overload signatures must all be ambient or non-ambient.
|
||||
tests/cases/conformance/functions/functionOverloadErrors.ts(90,18): error TS2384: Overload signatures must all be ambient or non-ambient.
|
||||
tests/cases/conformance/functions/functionOverloadErrors.ts(94,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/conformance/functions/functionOverloadErrors.ts(99,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/conformance/functions/functionOverloadErrors.ts(103,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/conformance/functions/functionOverloadErrors.ts(94,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
tests/cases/conformance/functions/functionOverloadErrors.ts(99,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
tests/cases/conformance/functions/functionOverloadErrors.ts(103,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
tests/cases/conformance/functions/functionOverloadErrors.ts(116,19): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
||||
|
||||
|
||||
@@ -121,20 +121,23 @@ tests/cases/conformance/functions/functionOverloadErrors.ts(116,19): error TS237
|
||||
//Function overloads with fewer params than implementation signature
|
||||
function fewerParams();
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/conformance/functions/functionOverloadErrors.ts:95:10: The implementation signature is declared here.
|
||||
function fewerParams(n: string) {
|
||||
}
|
||||
|
||||
//Function implementation whose parameter types are not assignable to all corresponding overload signature parameters
|
||||
function fn13(n: string);
|
||||
~~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/conformance/functions/functionOverloadErrors.ts:100:10: The implementation signature is declared here.
|
||||
function fn13(n: number) { }
|
||||
|
||||
//Function overloads where return types are not all subtype of implementation return type
|
||||
function fn14(n: string): string;
|
||||
~~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/conformance/functions/functionOverloadErrors.ts:104:10: The implementation signature is declared here.
|
||||
function fn14() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
tests/cases/compiler/functionOverloads11.ts(1,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/compiler/functionOverloads11.ts(1,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
|
||||
|
||||
==== tests/cases/compiler/functionOverloads11.ts (1 errors) ====
|
||||
function foo():number;
|
||||
~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/compiler/functionOverloads11.ts:2:10: The implementation signature is declared here.
|
||||
function foo():string { return "" }
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
tests/cases/compiler/functionOverloads17.ts(1,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/compiler/functionOverloads17.ts(1,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
|
||||
|
||||
==== tests/cases/compiler/functionOverloads17.ts (1 errors) ====
|
||||
function foo():{a:number;}
|
||||
~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/compiler/functionOverloads17.ts:2:10: The implementation signature is declared here.
|
||||
function foo():{a:string;} { return {a:""} }
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
tests/cases/compiler/functionOverloads18.ts(1,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/compiler/functionOverloads18.ts(1,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
|
||||
|
||||
==== tests/cases/compiler/functionOverloads18.ts (1 errors) ====
|
||||
function foo(bar:{a:number;});
|
||||
~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/compiler/functionOverloads18.ts:2:10: The implementation signature is declared here.
|
||||
function foo(bar:{a:string;}) { return {a:""} }
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
tests/cases/compiler/functionOverloads19.ts(1,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/compiler/functionOverloads19.ts(1,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
|
||||
|
||||
==== tests/cases/compiler/functionOverloads19.ts (1 errors) ====
|
||||
function foo(bar:{b:string;});
|
||||
~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/compiler/functionOverloads19.ts:3:10: The implementation signature is declared here.
|
||||
function foo(bar:{a:string;});
|
||||
function foo(bar:{a:any;}) { return {a:""} }
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
tests/cases/compiler/functionOverloads20.ts(1,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/compiler/functionOverloads20.ts(1,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
|
||||
|
||||
==== tests/cases/compiler/functionOverloads20.ts (1 errors) ====
|
||||
function foo(bar:{a:number;}): number;
|
||||
~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/compiler/functionOverloads20.ts:3:10: The implementation signature is declared here.
|
||||
function foo(bar:{a:string;}): string;
|
||||
function foo(bar:{a:any;}): string {return ""}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
tests/cases/compiler/functionOverloads4.ts(1,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/compiler/functionOverloads4.ts(1,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
|
||||
|
||||
==== tests/cases/compiler/functionOverloads4.ts (1 errors) ====
|
||||
function foo():number;
|
||||
~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/compiler/functionOverloads4.ts:2:10: The implementation signature is declared here.
|
||||
function foo():string { return "a" }
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/overloadAssignmentCompat.ts(34,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/compiler/overloadAssignmentCompat.ts(34,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
|
||||
|
||||
==== tests/cases/compiler/overloadAssignmentCompat.ts (1 errors) ====
|
||||
@@ -37,7 +37,8 @@ tests/cases/compiler/overloadAssignmentCompat.ts(34,10): error TS2394: Overload
|
||||
// error - signatures are not assignment compatible
|
||||
function foo():number;
|
||||
~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/compiler/overloadAssignmentCompat.ts:35:10: The implementation signature is declared here.
|
||||
function foo():string { return "a" };
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
tests/cases/compiler/overloadOnConstNoAnyImplementation.ts(1,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/compiler/overloadOnConstNoAnyImplementation.ts(1,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
tests/cases/compiler/overloadOnConstNoAnyImplementation.ts(9,8): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/overloadOnConstNoAnyImplementation.ts (2 errors) ====
|
||||
function x1(a: number, cb: (x: 'hi') => number);
|
||||
~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/compiler/overloadOnConstNoAnyImplementation.ts:3:10: The implementation signature is declared here.
|
||||
function x1(a: number, cb: (x: 'bye') => number);
|
||||
function x1(a: number, cb: (x: string) => number) {
|
||||
cb('hi');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(6,5): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(6,5): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(12,18): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
|
||||
tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(18,9): error TS2345: Argument of type '(x: "bye") => number' is not assignable to parameter of type '(x: "hi") => number'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
@@ -16,7 +16,8 @@ tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(21,9): error TS2345:
|
||||
class C {
|
||||
x1(a: number, callback: (x: 'hi') => number);
|
||||
~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts:7:5: The implementation signature is declared here.
|
||||
x1(a: number, callback: (x: string) => number) {
|
||||
callback('hi');
|
||||
callback('bye');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/overloadOnConstantsInvalidOverload1.ts(6,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/compiler/overloadOnConstantsInvalidOverload1.ts(6,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
tests/cases/compiler/overloadOnConstantsInvalidOverload1.ts(11,5): error TS2345: Argument of type '"HI"' is not assignable to parameter of type '"SPAN"'.
|
||||
|
||||
|
||||
@@ -10,7 +10,8 @@ tests/cases/compiler/overloadOnConstantsInvalidOverload1.ts(11,5): error TS2345:
|
||||
|
||||
function foo(name: "SPAN"): Derived1;
|
||||
~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/compiler/overloadOnConstantsInvalidOverload1.ts:7:10: The implementation signature is declared here.
|
||||
function foo(name: "DIV"): Derived2 {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
tests/cases/compiler/overloadingOnConstants2.ts(9,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/compiler/overloadingOnConstants2.ts(9,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
tests/cases/compiler/overloadingOnConstants2.ts(15,13): error TS2345: Argument of type '"um"' is not assignable to parameter of type '"bye"'.
|
||||
tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
|
||||
|
||||
==== tests/cases/compiler/overloadingOnConstants2.ts (3 errors) ====
|
||||
@@ -14,7 +14,8 @@ tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2394: Overload s
|
||||
function foo(x: "hi", items: string[]): D;
|
||||
function foo(x: "bye", items: string[]): E;
|
||||
~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/compiler/overloadingOnConstants2.ts:10:10: The implementation signature is declared here.
|
||||
function foo(x: string, items: string[]): C {
|
||||
return null;
|
||||
}
|
||||
@@ -28,7 +29,8 @@ tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2394: Overload s
|
||||
//function bar(x: "hi", items: string[]): D;
|
||||
function bar(x: "bye", items: string[]): E;
|
||||
~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/compiler/overloadingOnConstants2.ts:21:10: The implementation signature is declared here.
|
||||
function bar(x: string, items: string[]): C;
|
||||
function bar(x: string, items: string[]): C {
|
||||
return null;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/parameterPropertyInConstructor2.ts(3,5): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/compiler/parameterPropertyInConstructor2.ts(3,5): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
tests/cases/compiler/parameterPropertyInConstructor2.ts(3,17): error TS2369: A parameter property is only allowed in a constructor implementation.
|
||||
tests/cases/compiler/parameterPropertyInConstructor2.ts(4,24): error TS2300: Duplicate identifier 'names'.
|
||||
|
||||
@@ -8,7 +8,8 @@ tests/cases/compiler/parameterPropertyInConstructor2.ts(4,24): error TS2300: Dup
|
||||
class Customers {
|
||||
constructor(public names: string);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/compiler/parameterPropertyInConstructor2.ts:4:5: The implementation signature is declared here.
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
|
||||
constructor(public names: string, public ages: number) {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration12.ts(2,4): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration12.ts(2,4): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration12.ts (1 errors) ====
|
||||
class C {
|
||||
constructor();
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration12.ts:3:4: The implementation signature is declared here.
|
||||
constructor(a) { }
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ParameterLists/parserParameterList15.ts(1,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/conformance/parser/ecmascript5/ParameterLists/parserParameterList15.ts(1,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
tests/cases/conformance/parser/ecmascript5/ParameterLists/parserParameterList15.ts(1,14): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ParameterLists/parserParameterList15.ts (2 errors) ====
|
||||
function foo(a = 4);
|
||||
~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/conformance/parser/ecmascript5/ParameterLists/parserParameterList15.ts:2:10: The implementation signature is declared here.
|
||||
~~~~~
|
||||
!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
||||
function foo(a, b) {}
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ParameterLists/parserParameterList16.ts(2,4): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/conformance/parser/ecmascript5/ParameterLists/parserParameterList16.ts(2,4): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
tests/cases/conformance/parser/ecmascript5/ParameterLists/parserParameterList16.ts(2,8): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@ tests/cases/conformance/parser/ecmascript5/ParameterLists/parserParameterList16.
|
||||
class C {
|
||||
foo(a = 4);
|
||||
~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/conformance/parser/ecmascript5/ParameterLists/parserParameterList16.ts:3:4: The implementation signature is declared here.
|
||||
~~~~~
|
||||
!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
||||
foo(a, b) { }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ParameterLists/parserParameterList17.ts(2,4): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/conformance/parser/ecmascript5/ParameterLists/parserParameterList17.ts(2,4): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
tests/cases/conformance/parser/ecmascript5/ParameterLists/parserParameterList17.ts(2,16): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@ tests/cases/conformance/parser/ecmascript5/ParameterLists/parserParameterList17.
|
||||
class C {
|
||||
constructor(a = 4);
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/conformance/parser/ecmascript5/ParameterLists/parserParameterList17.ts:3:4: The implementation signature is declared here.
|
||||
~~~~~
|
||||
!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
||||
constructor(a, b) { }
|
||||
|
||||
@@ -7,7 +7,7 @@ tests/cases/compiler/recursiveFunctionTypes.ts(12,16): error TS2355: A function
|
||||
tests/cases/compiler/recursiveFunctionTypes.ts(17,5): error TS2322: Type '() => I<typeof f3>' is not assignable to type 'number'.
|
||||
tests/cases/compiler/recursiveFunctionTypes.ts(22,5): error TS2345: Argument of type '3' is not assignable to parameter of type '(t: typeof g) => void'.
|
||||
tests/cases/compiler/recursiveFunctionTypes.ts(25,1): error TS2322: Type '3' is not assignable to type '() => any'.
|
||||
tests/cases/compiler/recursiveFunctionTypes.ts(30,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/compiler/recursiveFunctionTypes.ts(30,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
tests/cases/compiler/recursiveFunctionTypes.ts(33,1): error TS2554: Expected 0-1 arguments, but got 2.
|
||||
tests/cases/compiler/recursiveFunctionTypes.ts(34,4): error TS2345: Argument of type '""' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'.
|
||||
tests/cases/compiler/recursiveFunctionTypes.ts(42,1): error TS2554: Expected 0-1 arguments, but got 2.
|
||||
@@ -63,7 +63,8 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of
|
||||
function f6(): typeof f6;
|
||||
function f6(a: typeof f6): () => number;
|
||||
~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/compiler/recursiveFunctionTypes.ts:31:10: The implementation signature is declared here.
|
||||
function f6(a?: any) { return f6; }
|
||||
|
||||
f6("", 3); // error (arity mismatch)
|
||||
|
||||
+3
-2
@@ -1,10 +1,11 @@
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/specializedSignatureIsNotSubtypeOfNonSpecializedSignature.ts(1,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/specializedSignatureIsNotSubtypeOfNonSpecializedSignature.ts(1,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/specializedSignatureIsNotSubtypeOfNonSpecializedSignature.ts (1 errors) ====
|
||||
function foo(x: 'a');
|
||||
~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/conformance/types/objectTypeLiteral/callSignatures/specializedSignatureIsNotSubtypeOfNonSpecializedSignature.ts:2:10: The implementation signature is declared here.
|
||||
function foo(x: number) { }
|
||||
|
||||
class C {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads05.ts(6,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads05.ts(6,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads05.ts (1 errors) ====
|
||||
@@ -9,7 +9,8 @@ tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads05.ts(6,1
|
||||
|
||||
function doThing(x: "dog"): Dog;
|
||||
~~~~~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads05.ts:9:10: The implementation signature is declared here.
|
||||
function doThing(x: "cat"): Cat;
|
||||
function doThing(x: string): Animal;
|
||||
function doThing(x: string, y?: string): Moose {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/conformance/es6/templates/templateStringInFunctionParameterType.ts(1,10): error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
tests/cases/conformance/es6/templates/templateStringInFunctionParameterType.ts(1,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/conformance/es6/templates/templateStringInFunctionParameterType.ts(1,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
tests/cases/conformance/es6/templates/templateStringInFunctionParameterType.ts(1,12): error TS1138: Parameter declaration expected.
|
||||
tests/cases/conformance/es6/templates/templateStringInFunctionParameterType.ts(1,19): error TS1005: ';' expected.
|
||||
|
||||
@@ -9,7 +9,8 @@ tests/cases/conformance/es6/templates/templateStringInFunctionParameterType.ts(1
|
||||
~
|
||||
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/conformance/es6/templates/templateStringInFunctionParameterType.ts:3:10: The implementation signature is declared here.
|
||||
~~~~~~~
|
||||
!!! error TS1138: Parameter declaration expected.
|
||||
~
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/conformance/es6/templates/templateStringInFunctionParameterTypeES6.ts(1,10): error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
tests/cases/conformance/es6/templates/templateStringInFunctionParameterTypeES6.ts(1,10): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/conformance/es6/templates/templateStringInFunctionParameterTypeES6.ts(1,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
tests/cases/conformance/es6/templates/templateStringInFunctionParameterTypeES6.ts(1,12): error TS1138: Parameter declaration expected.
|
||||
tests/cases/conformance/es6/templates/templateStringInFunctionParameterTypeES6.ts(1,19): error TS1005: ';' expected.
|
||||
|
||||
@@ -9,7 +9,8 @@ tests/cases/conformance/es6/templates/templateStringInFunctionParameterTypeES6.t
|
||||
~
|
||||
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/conformance/es6/templates/templateStringInFunctionParameterTypeES6.ts:3:10: The implementation signature is declared here.
|
||||
~~~~~~~
|
||||
!!! error TS1138: Parameter declaration expected.
|
||||
~
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/voidAsNonAmbiguousReturnType_0.ts(1,17): error TS2394: Overload signature is not compatible with function implementation.
|
||||
tests/cases/compiler/voidAsNonAmbiguousReturnType_0.ts(1,17): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
|
||||
|
||||
==== tests/cases/compiler/voidAsNonAmbiguousReturnType_1.ts (0 errors) ====
|
||||
@@ -12,6 +12,7 @@ tests/cases/compiler/voidAsNonAmbiguousReturnType_0.ts(1,17): error TS2394: Over
|
||||
==== tests/cases/compiler/voidAsNonAmbiguousReturnType_0.ts (1 errors) ====
|
||||
export function mkdirSync(path: string, mode?: number): void;
|
||||
~~~~~~~~~
|
||||
!!! error TS2394: Overload signature is not compatible with function implementation.
|
||||
!!! error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
!!! related TS2750 tests/cases/compiler/voidAsNonAmbiguousReturnType_0.ts:2:17: The implementation signature is declared here.
|
||||
export function mkdirSync(path: string, mode?: string): void {}
|
||||
|
||||
Reference in New Issue
Block a user