mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Report more "No overload matches this call" errors on call target nodes (#54447)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
e9737b893c
commit
24166a4ed8
+14
-1
@@ -33944,6 +33944,19 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
}
|
||||
}
|
||||
|
||||
function getErrorNodeForCallNode(callLike: CallLikeExpression): Node {
|
||||
if (isCallOrNewExpression(callLike)) {
|
||||
return isPropertyAccessExpression(callLike.expression) ? callLike.expression.name : callLike.expression;
|
||||
}
|
||||
if (isTaggedTemplateExpression(callLike)) {
|
||||
return isPropertyAccessExpression(callLike.tag) ? callLike.tag.name : callLike.tag;
|
||||
}
|
||||
if (isJsxOpeningLikeElement(callLike)) {
|
||||
return callLike.tagName;
|
||||
}
|
||||
return callLike;
|
||||
}
|
||||
|
||||
function isPromiseResolveArityError(node: CallLikeExpression) {
|
||||
if (!isCallExpression(node) || !isIdentifier(node.expression)) return false;
|
||||
|
||||
@@ -34267,7 +34280,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
diag = { file, start, length, code: chain.code, category: chain.category, messageText: chain, relatedInformation: related };
|
||||
}
|
||||
else {
|
||||
diag = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node), node, chain, related);
|
||||
diag = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node), getErrorNodeForCallNode(node), chain, related);
|
||||
}
|
||||
addImplementationSuccessElaboration(candidatesForArgumentError[0], diag);
|
||||
diagnostics.add(diag);
|
||||
|
||||
+4
-4
@@ -5,7 +5,7 @@ file.tsx(27,64): error TS2769: No overload matches this call.
|
||||
Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
|
||||
Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
file.tsx(28,12): error TS2769: No overload matches this call.
|
||||
file.tsx(28,13): error TS2769: No overload matches this call.
|
||||
Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
|
||||
Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
|
||||
@@ -19,7 +19,7 @@ file.tsx(29,43): error TS2769: No overload matches this call.
|
||||
Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
|
||||
Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
file.tsx(30,12): error TS2769: No overload matches this call.
|
||||
file.tsx(30,13): error TS2769: No overload matches this call.
|
||||
Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
|
||||
Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'.
|
||||
@@ -69,7 +69,7 @@ file.tsx(36,44): error TS2322: Type '{ extra: true; goTo: "home"; }' is not assi
|
||||
!!! error TS2769: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
const b2 = <MainButton onClick={(k)=>{console.log(k)}} extra />; // k has type "left" | "right"
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
!!! error TS2769: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
|
||||
@@ -87,7 +87,7 @@ file.tsx(36,44): error TS2322: Type '{ extra: true; goTo: "home"; }' is not assi
|
||||
!!! error TS2769: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
const b4 = <MainButton goTo="home" extra />; // goTo has type "home" | "contact"
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
!!! error TS2769: Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
dissallowSymbolAsWeakType.ts(3,12): error TS2769: No overload matches this call.
|
||||
dissallowSymbolAsWeakType.ts(3,16): error TS2769: No overload matches this call.
|
||||
Overload 1 of 2, '(iterable: Iterable<object>): WeakSet<object>', gave the following error.
|
||||
Argument of type 'symbol[]' is not assignable to parameter of type 'Iterable<object>'.
|
||||
The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types.
|
||||
@@ -11,7 +11,7 @@ dissallowSymbolAsWeakType.ts(3,12): error TS2769: No overload matches this call.
|
||||
dissallowSymbolAsWeakType.ts(4,8): error TS2345: Argument of type 'symbol' is not assignable to parameter of type 'object'.
|
||||
dissallowSymbolAsWeakType.ts(5,8): error TS2345: Argument of type 'symbol' is not assignable to parameter of type 'object'.
|
||||
dissallowSymbolAsWeakType.ts(6,11): error TS2345: Argument of type 'symbol' is not assignable to parameter of type 'object'.
|
||||
dissallowSymbolAsWeakType.ts(8,12): error TS2769: No overload matches this call.
|
||||
dissallowSymbolAsWeakType.ts(8,16): error TS2769: No overload matches this call.
|
||||
Overload 1 of 2, '(iterable: Iterable<readonly [object, boolean]>): WeakMap<object, boolean>', gave the following error.
|
||||
Argument of type '[symbol, false][]' is not assignable to parameter of type 'Iterable<readonly [object, boolean]>'.
|
||||
The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types.
|
||||
@@ -36,7 +36,7 @@ dissallowSymbolAsWeakType.ts(19,14): error TS2345: Argument of type 'symbol' is
|
||||
const s: symbol = Symbol('s');
|
||||
|
||||
const ws = new WeakSet([s]);
|
||||
~~~~~~~~~~~~~~~~
|
||||
~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 2, '(iterable: Iterable<object>): WeakSet<object>', gave the following error.
|
||||
!!! error TS2769: Argument of type 'symbol[]' is not assignable to parameter of type 'Iterable<object>'.
|
||||
@@ -58,7 +58,7 @@ dissallowSymbolAsWeakType.ts(19,14): error TS2345: Argument of type 'symbol' is
|
||||
!!! error TS2345: Argument of type 'symbol' is not assignable to parameter of type 'object'.
|
||||
|
||||
const wm = new WeakMap([[s, false]]);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 2, '(iterable: Iterable<readonly [object, boolean]>): WeakMap<object, boolean>', gave the following error.
|
||||
!!! error TS2769: Argument of type '[symbol, false][]' is not assignable to parameter of type 'Iterable<readonly [object, boolean]>'.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
for-of39.ts(1,11): error TS2769: No overload matches this call.
|
||||
for-of39.ts(1,15): error TS2769: No overload matches this call.
|
||||
Overload 1 of 4, '(iterable?: Iterable<readonly [string, boolean]>): Map<string, boolean>', gave the following error.
|
||||
Argument of type '([string, number] | [string, true])[]' is not assignable to parameter of type 'Iterable<readonly [string, boolean]>'.
|
||||
The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types.
|
||||
@@ -15,7 +15,7 @@ for-of39.ts(1,11): error TS2769: No overload matches this call.
|
||||
|
||||
==== for-of39.ts (1 errors) ====
|
||||
var map = new Map([["", true], ["", 0]]);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 4, '(iterable?: Iterable<readonly [string, boolean]>): Map<string, boolean>', gave the following error.
|
||||
!!! error TS2769: Argument of type '([string, number] | [string, true])[]' is not assignable to parameter of type 'Iterable<readonly [string, boolean]>'.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
inheritedConstructorWithRestParams2.ts(32,13): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
|
||||
inheritedConstructorWithRestParams2.ts(33,1): error TS2769: No overload matches this call.
|
||||
inheritedConstructorWithRestParams2.ts(33,5): error TS2769: No overload matches this call.
|
||||
Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error.
|
||||
Argument of type 'string' is not assignable to parameter of type 'number'.
|
||||
Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error.
|
||||
Argument of type 'number' is not assignable to parameter of type 'string'.
|
||||
inheritedConstructorWithRestParams2.ts(34,1): error TS2769: No overload matches this call.
|
||||
inheritedConstructorWithRestParams2.ts(34,5): error TS2769: No overload matches this call.
|
||||
Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error.
|
||||
Argument of type 'string' is not assignable to parameter of type 'number'.
|
||||
Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error.
|
||||
@@ -47,14 +47,14 @@ inheritedConstructorWithRestParams2.ts(34,1): error TS2769: No overload matches
|
||||
~
|
||||
!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
|
||||
new Derived("", 3, "", 3);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error.
|
||||
!!! error TS2769: Argument of type 'string' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2769: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error.
|
||||
!!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'string'.
|
||||
new Derived("", 3, "", "");
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error.
|
||||
!!! error TS2769: Argument of type 'string' is not assignable to parameter of type 'number'.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
iterableArrayPattern28.ts(2,24): error TS2769: No overload matches this call.
|
||||
iterableArrayPattern28.ts(2,28): error TS2769: No overload matches this call.
|
||||
Overload 1 of 4, '(iterable?: Iterable<readonly [string, number]>): Map<string, number>', gave the following error.
|
||||
Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable<readonly [string, number]>'.
|
||||
The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types.
|
||||
@@ -16,7 +16,7 @@ iterableArrayPattern28.ts(2,24): error TS2769: No overload matches this call.
|
||||
==== iterableArrayPattern28.ts (1 errors) ====
|
||||
function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { }
|
||||
takeFirstTwoEntries(...new Map([["", 0], ["hello", true]]));
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 4, '(iterable?: Iterable<readonly [string, number]>): Map<string, number>', gave the following error.
|
||||
!!! error TS2769: Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable<readonly [string, number]>'.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
index.tsx(11,5): error TS2769: No overload matches this call.
|
||||
index.tsx(11,6): error TS2769: No overload matches this call.
|
||||
Overload 2 of 2, '(props: PropsType, context: any): Foo', gave the following error.
|
||||
Type 'unknown' is not assignable to type 'string | boolean'.
|
||||
Overload 2 of 2, '(props: PropsType, context: any): Foo', gave the following error.
|
||||
@@ -17,7 +17,7 @@ index.tsx(11,5): error TS2769: No overload matches this call.
|
||||
declare class Foo extends React.Component<PropsType, {}> {}
|
||||
const b = (
|
||||
<Foo>
|
||||
~~~~~
|
||||
~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 2 of 2, '(props: PropsType, context: any): Foo', gave the following error.
|
||||
!!! error TS2769: Type 'unknown' is not assignable to type 'string | boolean'.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
other.tsx(10,5): error TS2769: No overload matches this call.
|
||||
other.tsx(10,6): error TS2769: No overload matches this call.
|
||||
Overload 2 of 2, '(props: PropsType, context: any): Foo', gave the following error.
|
||||
Type 'unknown' is not assignable to type 'string | boolean'.
|
||||
Overload 2 of 2, '(props: PropsType, context: any): Foo', gave the following error.
|
||||
@@ -16,7 +16,7 @@ other.tsx(10,5): error TS2769: No overload matches this call.
|
||||
declare class Foo extends React.Component<PropsType, {}> {}
|
||||
const b = (
|
||||
<Foo>
|
||||
~~~~~
|
||||
~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 2 of 2, '(props: PropsType, context: any): Foo', gave the following error.
|
||||
!!! error TS2769: Type 'unknown' is not assignable to type 'string | boolean'.
|
||||
|
||||
@@ -33,7 +33,7 @@ orderMattersForSignatureGroupIdentity.ts(24,20): error TS2339: Property 'toLower
|
||||
var v: B;
|
||||
|
||||
v({ s: "", n: 0 }).toLowerCase();
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 2, '(x: { s: string; }): string', gave the following error.
|
||||
!!! error TS2769: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'.
|
||||
@@ -49,7 +49,7 @@ orderMattersForSignatureGroupIdentity.ts(24,20): error TS2339: Property 'toLower
|
||||
!!! related TS6203 orderMattersForSignatureGroupIdentity.ts:21:5: 'w' was also declared here.
|
||||
|
||||
w({ s: "", n: 0 }).toLowerCase();
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 2, '(x: { s: string; }): string', gave the following error.
|
||||
!!! error TS2769: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'.
|
||||
|
||||
@@ -3,7 +3,7 @@ overload1.ts(29,1): error TS2322: Type 'number' is not assignable to type 'strin
|
||||
overload1.ts(31,11): error TS2554: Expected 1-2 arguments, but got 3.
|
||||
overload1.ts(32,5): error TS2554: Expected 1-2 arguments, but got 0.
|
||||
overload1.ts(33,1): error TS2322: Type 'C' is not assignable to type 'string'.
|
||||
overload1.ts(34,3): error TS2769: No overload matches this call.
|
||||
overload1.ts(34,5): error TS2769: No overload matches this call.
|
||||
Overload 1 of 2, '(s1: string, s2: number): string', gave the following error.
|
||||
Argument of type 'number' is not assignable to parameter of type 'string'.
|
||||
Overload 2 of 2, '(s1: number, s2: string): number', gave the following error.
|
||||
@@ -56,7 +56,7 @@ overload1.ts(34,3): error TS2769: No overload matches this call.
|
||||
~
|
||||
!!! error TS2322: Type 'C' is not assignable to type 'string'.
|
||||
z=x.h(2,2); // no match
|
||||
~~~~~~~~
|
||||
~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 2, '(s1: string, s2: number): string', gave the following error.
|
||||
!!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'string'.
|
||||
|
||||
@@ -40,7 +40,7 @@ overloadTag1.js(43,1): error TS2769: No overload matches this call.
|
||||
}
|
||||
var o1 = overloaded(1,2)
|
||||
var o2 = overloaded("zero", "one")
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 2, '(a: number, b: number): number', gave the following error.
|
||||
!!! error TS2769: Argument of type 'string' is not assignable to parameter of type 'number'.
|
||||
@@ -64,7 +64,7 @@ overloadTag1.js(43,1): error TS2769: No overload matches this call.
|
||||
}
|
||||
uncheckedInternally(1,2)
|
||||
uncheckedInternally("zero", "one")
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 2, '(a: number, b: number): number', gave the following error.
|
||||
!!! error TS2769: Argument of type 'string' is not assignable to parameter of type 'number'.
|
||||
|
||||
+2
-2
@@ -53,7 +53,7 @@ overloadresolutionWithConstraintCheckingDeferred.ts(19,14): error TS2344: Type '
|
||||
declare function foo(arg: (x: B) => any): number;
|
||||
|
||||
var result: number = foo(x => new G(x)); // x has type D, new G(x) fails, so first overload is picked.
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error.
|
||||
!!! error TS2769: Type 'G<A>' is not assignable to type 'number'.
|
||||
@@ -74,7 +74,7 @@ overloadresolutionWithConstraintCheckingDeferred.ts(19,14): error TS2344: Type '
|
||||
!!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:1:15: 'x' is declared here.
|
||||
|
||||
var result2: number = foo(x => new G<typeof x>(x)); // x has type D, new G(x) fails, so first overload is picked.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error.
|
||||
!!! error TS2769: Type 'G<D>' is not assignable to type 'number'.
|
||||
|
||||
@@ -19,7 +19,7 @@ overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cannot find name 'blah'.
|
||||
};
|
||||
|
||||
func(s => ({})); // Error for no applicable overload (object type is missing a and b)
|
||||
~~~~~~~~~~~~~~~
|
||||
~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 2, '(s: string): number', gave the following error.
|
||||
!!! error TS2769: Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'.
|
||||
@@ -30,7 +30,7 @@ overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cannot find name 'blah'.
|
||||
~~~~
|
||||
!!! error TS2304: Cannot find name 'blah'.
|
||||
func(s => ({ a: blah })); // Two errors here, one for blah not being defined, and one for the overload since it would not be applicable anyway
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 2, '(s: string): number', gave the following error.
|
||||
!!! error TS2769: Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'.
|
||||
|
||||
@@ -22,7 +22,7 @@ specializedSignatureAsCallbackParameter1.ts(8,1): error TS2769: No overload matc
|
||||
}
|
||||
// both are errors
|
||||
x3(1, (x: string) => 1);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: string) => number' is not assignable to parameter of type '(x: number) => number'.
|
||||
@@ -31,7 +31,7 @@ specializedSignatureAsCallbackParameter1.ts(8,1): error TS2769: No overload matc
|
||||
!!! error TS2769: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error.
|
||||
!!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'string'.
|
||||
x3(1, (x: 'hm') => 1);
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error.
|
||||
!!! error TS2769: Argument of type '(x: 'hm') => number' is not assignable to parameter of type '(x: number) => number'.
|
||||
|
||||
@@ -32,7 +32,7 @@ strictBindCallApply1.ts(70,12): error TS2345: Argument of type '[number]' is not
|
||||
strictBindCallApply1.ts(71,17): error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
strictBindCallApply1.ts(72,12): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[a: number, b: string]'.
|
||||
Source has 3 element(s) but target allows only 2.
|
||||
strictBindCallApply1.ts(76,5): error TS2769: No overload matches this call.
|
||||
strictBindCallApply1.ts(76,14): error TS2769: No overload matches this call.
|
||||
Overload 1 of 2, '(this: (this: 1, ...args: T) => void, thisArg: 1): (...args: T) => void', gave the following error.
|
||||
Argument of type '2' is not assignable to parameter of type '1'.
|
||||
Overload 2 of 2, '(this: (this: 1, ...args: unknown[]) => void, thisArg: 1): (...args: unknown[]) => void', gave the following error.
|
||||
@@ -40,7 +40,7 @@ strictBindCallApply1.ts(76,5): error TS2769: No overload matches this call.
|
||||
Types of parameters 'args' and 'args' are incompatible.
|
||||
Type 'unknown[]' is not assignable to type 'T'.
|
||||
'unknown[]' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'unknown[]'.
|
||||
strictBindCallApply1.ts(81,5): error TS2769: No overload matches this call.
|
||||
strictBindCallApply1.ts(81,14): error TS2769: No overload matches this call.
|
||||
Overload 1 of 2, '(this: (this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void, thisArg: 1): (...args: T extends 1 ? [unknown] : [unknown, unknown]) => void', gave the following error.
|
||||
Argument of type '2' is not assignable to parameter of type '1'.
|
||||
Overload 2 of 2, '(this: (this: 1, args_0: unknown) => void, thisArg: 1): (args_0: unknown) => void', gave the following error.
|
||||
@@ -184,7 +184,7 @@ strictBindCallApply1.ts(81,5): error TS2769: No overload matches this call.
|
||||
function bar<T extends unknown[]>(callback: (this: 1, ...args: T) => void) {
|
||||
callback.bind(1);
|
||||
callback.bind(2); // Error
|
||||
~~~~~~~~~~~~~~~~
|
||||
~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 2, '(this: (this: 1, ...args: T) => void, thisArg: 1): (...args: T) => void', gave the following error.
|
||||
!!! error TS2769: Argument of type '2' is not assignable to parameter of type '1'.
|
||||
@@ -198,7 +198,7 @@ strictBindCallApply1.ts(81,5): error TS2769: No overload matches this call.
|
||||
function baz<T extends 1 | 2>(callback: (this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void) {
|
||||
callback.bind(1);
|
||||
callback.bind(2); // Error
|
||||
~~~~~~~~~~~~~~~~
|
||||
~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 2, '(this: (this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void, thisArg: 1): (...args: T extends 1 ? [unknown] : [unknown, unknown]) => void', gave the following error.
|
||||
!!! error TS2769: Argument of type '2' is not assignable to parameter of type '1'.
|
||||
|
||||
@@ -5,7 +5,7 @@ file.tsx(12,22): error TS2769: No overload matches this call.
|
||||
Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error.
|
||||
Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
|
||||
Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
|
||||
file.tsx(13,12): error TS2769: No overload matches this call.
|
||||
file.tsx(13,13): error TS2769: No overload matches this call.
|
||||
Overload 1 of 2, '(): Element', gave the following error.
|
||||
Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'.
|
||||
Property 'yy' does not exist on type 'IntrinsicAttributes'.
|
||||
@@ -38,20 +38,20 @@ file.tsx(25,13): error TS2769: No overload matches this call.
|
||||
Type 'boolean' is not assignable to type 'string'.
|
||||
Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error.
|
||||
Property 'yy' is missing in type '{ "extra-data": true; }' but required in type '{ yy: string; direction?: number; }'.
|
||||
file.tsx(26,12): error TS2769: No overload matches this call.
|
||||
file.tsx(26,13): error TS2769: No overload matches this call.
|
||||
Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error.
|
||||
Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'.
|
||||
Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'.
|
||||
Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
file.tsx(33,12): error TS2769: No overload matches this call.
|
||||
file.tsx(33,13): error TS2769: No overload matches this call.
|
||||
Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error.
|
||||
Type 'boolean' is not assignable to type 'string'.
|
||||
Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error.
|
||||
Type 'boolean' is not assignable to type 'string'.
|
||||
Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error.
|
||||
Type 'string' is not assignable to type 'boolean'.
|
||||
file.tsx(34,12): error TS2769: No overload matches this call.
|
||||
file.tsx(34,13): error TS2769: No overload matches this call.
|
||||
Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error.
|
||||
Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
|
||||
Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
|
||||
@@ -60,7 +60,7 @@ file.tsx(34,12): error TS2769: No overload matches this call.
|
||||
Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'.
|
||||
Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error.
|
||||
Type 'string' is not assignable to type 'boolean'.
|
||||
file.tsx(35,12): error TS2769: No overload matches this call.
|
||||
file.tsx(35,13): error TS2769: No overload matches this call.
|
||||
Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error.
|
||||
Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
|
||||
Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
|
||||
@@ -68,7 +68,7 @@ file.tsx(35,12): error TS2769: No overload matches this call.
|
||||
Type 'string' is not assignable to type 'Element'.
|
||||
Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error.
|
||||
Type 'string' is not assignable to type 'boolean'.
|
||||
file.tsx(36,12): error TS2769: No overload matches this call.
|
||||
file.tsx(36,13): error TS2769: No overload matches this call.
|
||||
Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error.
|
||||
Type '{ children: string; y1: string; y2: number; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
|
||||
Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
|
||||
@@ -100,7 +100,7 @@ file.tsx(36,12): error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
|
||||
!!! error TS2769: Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
|
||||
const c1 = <OneThing yy={10}/>; // missing property;
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 2, '(): Element', gave the following error.
|
||||
!!! error TS2769: Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'.
|
||||
@@ -154,7 +154,7 @@ file.tsx(36,12): error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Property 'yy' is missing in type '{ "extra-data": true; }' but required in type '{ yy: string; direction?: number; }'.
|
||||
!!! related TS2728 file.tsx:22:38: 'yy' is declared here.
|
||||
const d2 = <TestingOneThing yy="hello" direction="left" />
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error.
|
||||
!!! error TS2769: Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'.
|
||||
@@ -169,7 +169,7 @@ file.tsx(36,12): error TS2769: No overload matches this call.
|
||||
|
||||
// Error
|
||||
const e1 = <TestingOptional y1 y3="hello"/>
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error.
|
||||
!!! error TS2769: Type 'boolean' is not assignable to type 'string'.
|
||||
@@ -181,7 +181,7 @@ file.tsx(36,12): error TS2769: No overload matches this call.
|
||||
!!! related TS6500 file.tsx:29:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'
|
||||
!!! related TS6500 file.tsx:30:64: The expected type comes from property 'y3' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }'
|
||||
const e2 = <TestingOptional y1="hello" y2={1000} y3 />
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error.
|
||||
!!! error TS2769: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
|
||||
@@ -193,7 +193,7 @@ file.tsx(36,12): error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Type 'string' is not assignable to type 'boolean'.
|
||||
!!! related TS6500 file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }'
|
||||
const e3 = <TestingOptional y1="hello" y2={1000} children="hi" />
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error.
|
||||
!!! error TS2769: Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
|
||||
@@ -205,7 +205,7 @@ file.tsx(36,12): error TS2769: No overload matches this call.
|
||||
!!! related TS6500 file.tsx:29:64: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'
|
||||
!!! related TS6500 file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }'
|
||||
const e4 = <TestingOptional y1="hello" y2={1000}>Hi</TestingOptional>
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error.
|
||||
!!! error TS2769: Type '{ children: string; y1: string; y2: number; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
file.tsx(48,12): error TS2769: No overload matches this call.
|
||||
file.tsx(48,13): error TS2769: No overload matches this call.
|
||||
Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
Type '{ children: string; to: string; onClick: (e: MouseEvent<any>) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
|
||||
Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'.
|
||||
@@ -82,7 +82,7 @@ file.tsx(56,13): error TS2769: No overload matches this call.
|
||||
|
||||
// Error
|
||||
const b0 = <MainButton to='/some/path' onClick={(e)=>{}}>GO</MainButton>; // extra property;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
!!! error TS2769: Type '{ children: string; to: string; onClick: (e: MouseEvent<any>) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
file.tsx(9,14): error TS2769: No overload matches this call.
|
||||
file.tsx(9,15): error TS2769: No overload matches this call.
|
||||
Overload 1 of 3, '(): Element', gave the following error.
|
||||
Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'.
|
||||
Property 'a' does not exist on type 'IntrinsicAttributes'.
|
||||
@@ -27,7 +27,7 @@ file.tsx(10,15): error TS2769: No overload matches this call.
|
||||
// Error
|
||||
function Baz<T extends {b: number}, U extends {a: boolean, b:string}>(arg1: T, arg2: U) {
|
||||
let a0 = <OverloadComponent a={arg1.b}/>
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 3, '(): Element', gave the following error.
|
||||
!!! error TS2769: Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
underscoreTest1_underscoreTests.ts(26,1): error TS2769: No overload matches this call.
|
||||
underscoreTest1_underscoreTests.ts(26,3): error TS2769: No overload matches this call.
|
||||
Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_<string | number | boolean, boolean>, context?: any): boolean', gave the following error.
|
||||
Argument of type '<T>(value: T) => T' is not assignable to parameter of type 'Iterator_<string | number | boolean, boolean>'.
|
||||
Type 'string | number | boolean' is not assignable to type 'boolean'.
|
||||
@@ -35,7 +35,7 @@ underscoreTest1_underscoreTests.ts(26,1): error TS2769: No overload matches this
|
||||
var odds = _.reject([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0);
|
||||
|
||||
_.all([true, 1, null, 'yes'], _.identity);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_<string | number | boolean, boolean>, context?: any): boolean', gave the following error.
|
||||
!!! error TS2769: Argument of type '<T>(value: T) => T' is not assignable to parameter of type 'Iterator_<string | number | boolean, boolean>'.
|
||||
|
||||
Reference in New Issue
Block a user