Convert related spans to message chains
This commit is contained in:
parent
ba9d8e2e81
commit
47bbc9546e
37 changed files with 928 additions and 464 deletions
|
@ -21655,8 +21655,10 @@ namespace ts {
|
|||
i++;
|
||||
}
|
||||
|
||||
const related = max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics);
|
||||
diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(undefined, Diagnostics.No_overload_matches_this_call), related));
|
||||
const related = map(
|
||||
max > 1 ? allDiagnostics[minIndex] : flatten(allDiagnostics),
|
||||
d => typeof d.messageText === 'string' ? (d as DiagnosticMessageChain) : d.messageText);
|
||||
diagnostics.add(createDiagnosticForNodeFromMessageChain(node, chainDiagnosticMessages(related, Diagnostics.No_overload_matches_this_call)));
|
||||
}
|
||||
}
|
||||
else if (candidateForArgumentArityError) {
|
||||
|
|
|
@ -1,7 +1,28 @@
|
|||
tests/cases/compiler/bigintWithLib.ts(4,1): error TS2350: Only a void function can be called with the 'new' keyword.
|
||||
tests/cases/compiler/bigintWithLib.ts(16,15): error TS2755: No overload matches this call.
|
||||
Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error.
|
||||
Argument of type 'number[]' is not assignable to parameter of type 'number'.
|
||||
Overload 2 of 3, '(array: Iterable<bigint>): BigInt64Array', gave the following error.
|
||||
Argument of type 'number[]' is not assignable to parameter of type 'Iterable<bigint>'.
|
||||
Types of property '[Symbol.iterator]' are incompatible.
|
||||
Type '() => IterableIterator<number>' is not assignable to type '() => Iterator<bigint>'.
|
||||
Type 'IterableIterator<number>' is not assignable to type 'Iterator<bigint>'.
|
||||
Types of property 'next' are incompatible.
|
||||
Type '(value?: any) => IteratorResult<number>' is not assignable to type '(value?: any) => IteratorResult<bigint>'.
|
||||
Type 'IteratorResult<number>' is not assignable to type 'IteratorResult<bigint>'.
|
||||
Type 'number' is not assignable to type 'bigint'.
|
||||
Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigInt64Array', gave the following error.
|
||||
Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
|
||||
Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag]
|
||||
tests/cases/compiler/bigintWithLib.ts(21,13): error TS2540: Cannot assign to 'length' because it is a read-only property.
|
||||
tests/cases/compiler/bigintWithLib.ts(28,16): error TS2755: No overload matches this call.
|
||||
Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error.
|
||||
Argument of type 'number[]' is not assignable to parameter of type 'number'.
|
||||
Overload 2 of 3, '(array: Iterable<bigint>): BigUint64Array', gave the following error.
|
||||
Argument of type 'number[]' is not assignable to parameter of type 'Iterable<bigint>'.
|
||||
Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigUint64Array', gave the following error.
|
||||
Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
|
||||
Type 'number[]' is not assignable to type 'SharedArrayBuffer'.
|
||||
tests/cases/compiler/bigintWithLib.ts(33,13): error TS2540: Cannot assign to 'length' because it is a read-only property.
|
||||
tests/cases/compiler/bigintWithLib.ts(40,25): error TS2345: Argument of type '-1' is not assignable to parameter of type 'bigint'.
|
||||
tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '123' is not assignable to parameter of type 'bigint'.
|
||||
|
@ -28,20 +49,20 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12
|
|||
bigIntArray = new BigInt64Array([1, 2, 3]); // should error
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/bigintWithLib.ts:16:33: Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error.
|
||||
Argument of type 'number[]' is not assignable to parameter of type 'number'.
|
||||
!!! related TS2760 tests/cases/compiler/bigintWithLib.ts:16:33: Overload 2 of 3, '(array: Iterable<bigint>): BigInt64Array', gave the following error.
|
||||
Argument of type 'number[]' is not assignable to parameter of type 'Iterable<bigint>'.
|
||||
Types of property '[Symbol.iterator]' are incompatible.
|
||||
Type '() => IterableIterator<number>' is not assignable to type '() => Iterator<bigint>'.
|
||||
Type 'IterableIterator<number>' is not assignable to type 'Iterator<bigint>'.
|
||||
Types of property 'next' are incompatible.
|
||||
Type '(value?: any) => IteratorResult<number>' is not assignable to type '(value?: any) => IteratorResult<bigint>'.
|
||||
Type 'IteratorResult<number>' is not assignable to type 'IteratorResult<bigint>'.
|
||||
Type 'number' is not assignable to type 'bigint'.
|
||||
!!! related TS2760 tests/cases/compiler/bigintWithLib.ts:16:33: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigInt64Array', gave the following error.
|
||||
Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
|
||||
Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag]
|
||||
!!! error TS2755: Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error.
|
||||
!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 2 of 3, '(array: Iterable<bigint>): BigInt64Array', gave the following error.
|
||||
!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'Iterable<bigint>'.
|
||||
!!! error TS2755: Types of property '[Symbol.iterator]' are incompatible.
|
||||
!!! error TS2755: Type '() => IterableIterator<number>' is not assignable to type '() => Iterator<bigint>'.
|
||||
!!! error TS2755: Type 'IterableIterator<number>' is not assignable to type 'Iterator<bigint>'.
|
||||
!!! error TS2755: Types of property 'next' are incompatible.
|
||||
!!! error TS2755: Type '(value?: any) => IteratorResult<number>' is not assignable to type '(value?: any) => IteratorResult<bigint>'.
|
||||
!!! error TS2755: Type 'IteratorResult<number>' is not assignable to type 'IteratorResult<bigint>'.
|
||||
!!! error TS2755: Type 'number' is not assignable to type 'bigint'.
|
||||
!!! error TS2755: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigInt64Array', gave the following error.
|
||||
!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
|
||||
!!! error TS2755: Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag]
|
||||
bigIntArray = new BigInt64Array(new ArrayBuffer(80));
|
||||
bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8);
|
||||
bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8, 3);
|
||||
|
@ -58,13 +79,13 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12
|
|||
bigUintArray = new BigUint64Array([1, 2, 3]); // should error
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/bigintWithLib.ts:28:35: Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error.
|
||||
Argument of type 'number[]' is not assignable to parameter of type 'number'.
|
||||
!!! related TS2760 tests/cases/compiler/bigintWithLib.ts:28:35: Overload 2 of 3, '(array: Iterable<bigint>): BigUint64Array', gave the following error.
|
||||
Argument of type 'number[]' is not assignable to parameter of type 'Iterable<bigint>'.
|
||||
!!! related TS2760 tests/cases/compiler/bigintWithLib.ts:28:35: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigUint64Array', gave the following error.
|
||||
Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
|
||||
Type 'number[]' is not assignable to type 'SharedArrayBuffer'.
|
||||
!!! error TS2755: Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error.
|
||||
!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 2 of 3, '(array: Iterable<bigint>): BigUint64Array', gave the following error.
|
||||
!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'Iterable<bigint>'.
|
||||
!!! error TS2755: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigUint64Array', gave the following error.
|
||||
!!! error TS2755: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
|
||||
!!! error TS2755: Type 'number[]' is not assignable to type 'SharedArrayBuffer'.
|
||||
bigUintArray = new BigUint64Array(new ArrayBuffer(80));
|
||||
bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8);
|
||||
bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8, 3);
|
||||
|
|
|
@ -3,7 +3,15 @@ tests/cases/compiler/constructorOverloads1.ts(3,5): error TS2392: Multiple const
|
|||
tests/cases/compiler/constructorOverloads1.ts(4,5): error TS2392: Multiple constructor implementations are not allowed.
|
||||
tests/cases/compiler/constructorOverloads1.ts(7,5): error TS2392: Multiple constructor implementations are not allowed.
|
||||
tests/cases/compiler/constructorOverloads1.ts(16,10): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(s: string): Foo', gave the following error.
|
||||
Argument of type 'Foo' is not assignable to parameter of type 'string'.
|
||||
Overload 2 of 2, '(n: number): Foo', gave the following error.
|
||||
Argument of type 'Foo' is not assignable to parameter of type 'number'.
|
||||
tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(s: string): Foo', gave the following error.
|
||||
Argument of type 'any[]' is not assignable to parameter of type 'string'.
|
||||
Overload 2 of 2, '(n: number): Foo', gave the following error.
|
||||
Argument of type 'any[]' is not assignable to parameter of type 'number'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/constructorOverloads1.ts (6 errors) ====
|
||||
|
@ -37,17 +45,17 @@ tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2755: No overload
|
|||
var f3 = new Foo(f1);
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/constructorOverloads1.ts:16:18: Overload 1 of 2, '(s: string): Foo', gave the following error.
|
||||
Argument of type 'Foo' is not assignable to parameter of type 'string'.
|
||||
!!! related TS2760 tests/cases/compiler/constructorOverloads1.ts:16:18: Overload 2 of 2, '(n: number): Foo', gave the following error.
|
||||
Argument of type 'Foo' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 1 of 2, '(s: string): Foo', gave the following error.
|
||||
!!! error TS2755: Argument of type 'Foo' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 2 of 2, '(n: number): Foo', gave the following error.
|
||||
!!! error TS2755: Argument of type 'Foo' is not assignable to parameter of type 'number'.
|
||||
var f4 = new Foo([f1,f2,f3]);
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/constructorOverloads1.ts:17:18: Overload 1 of 2, '(s: string): Foo', gave the following error.
|
||||
Argument of type 'any[]' is not assignable to parameter of type 'string'.
|
||||
!!! related TS2760 tests/cases/compiler/constructorOverloads1.ts:17:18: Overload 2 of 2, '(n: number): Foo', gave the following error.
|
||||
Argument of type 'any[]' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 1 of 2, '(s: string): Foo', gave the following error.
|
||||
!!! error TS2755: Argument of type 'any[]' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 2 of 2, '(n: number): Foo', gave the following error.
|
||||
!!! error TS2755: Argument of type 'any[]' is not assignable to parameter of type 'number'.
|
||||
|
||||
f1.bar1();
|
||||
f1.bar2();
|
||||
|
|
|
@ -1,7 +1,31 @@
|
|||
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(27,12): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
|
||||
Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
|
||||
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'.
|
||||
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(28,12): error TS2755: 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'.
|
||||
Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
|
||||
Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(29,12): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
Type '{ extra: true; goTo: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
|
||||
Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
|
||||
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'.
|
||||
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(30,12): error TS2755: 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'.
|
||||
Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
|
||||
Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(33,13): error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
|
||||
Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
|
||||
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,13): error TS2322: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
|
@ -38,39 +62,39 @@ tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,13): err
|
|||
const b0 = <MainButton {...{onClick: (k) => {console.log(k)}}} extra />; // k has type "left" | "right"
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:27:13: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
|
||||
Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
|
||||
!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:27:13: 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'.
|
||||
!!! error TS2755: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
|
||||
!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
|
||||
!!! error TS2755: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
const b2 = <MainButton onClick={(k)=>{console.log(k)}} extra />; // k has type "left" | "right"
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:28:13: 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'.
|
||||
!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:28:13: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
|
||||
Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
!!! error TS2755: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
|
||||
!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
|
||||
!!! error TS2755: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
!!! error TS2755: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
const b3 = <MainButton {...{goTo:"home"}} extra />; // goTo has type"home" | "contact"
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:29:13: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
Type '{ extra: true; goTo: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
|
||||
Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
|
||||
!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:29:13: 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'.
|
||||
!!! error TS2755: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ extra: true; goTo: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
|
||||
!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
|
||||
!!! error TS2755: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
const b4 = <MainButton goTo="home" extra />; // goTo has type "home" | "contact"
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:30:13: 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'.
|
||||
!!! related TS2760 tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx:30:13: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
|
||||
Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
!!! error TS2755: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
|
||||
!!! error TS2755: Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'.
|
||||
!!! error TS2755: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
!!! error TS2755: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
|
||||
export function NoOverload(buttonProps: ButtonProps): JSX.Element { return undefined }
|
||||
const c1 = <NoOverload {...{onClick: (k) => {console.log(k)}}} extra />; // k has type any
|
||||
|
|
|
@ -3,7 +3,19 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(11,17): error
|
|||
tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(22,17): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'string'.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(34,13): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(x: string): number', gave the following error.
|
||||
Argument of type 'string | number' is not assignable to parameter of type 'string'.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
Overload 2 of 2, '(x: number): string', gave the following error.
|
||||
Argument of type 'string | number' is not assignable to parameter of type 'number'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(x: string): number', gave the following error.
|
||||
Argument of type 'string | number' is not assignable to parameter of type 'string'.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
Overload 2 of 2, '(x: number): string', gave the following error.
|
||||
Argument of type 'string | number' is not assignable to parameter of type 'number'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts (4 errors) ====
|
||||
|
@ -49,12 +61,12 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error
|
|||
x = foo(x);
|
||||
~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:34:17: Overload 1 of 2, '(x: string): number', gave the following error.
|
||||
Argument of type 'string | number' is not assignable to parameter of type 'string'.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:34:17: Overload 2 of 2, '(x: number): string', gave the following error.
|
||||
Argument of type 'string | number' is not assignable to parameter of type 'number'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
!!! error TS2755: Overload 1 of 2, '(x: string): number', gave the following error.
|
||||
!!! error TS2755: Argument of type 'string | number' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Type 'number' is not assignable to type 'string'.
|
||||
!!! error TS2755: Overload 2 of 2, '(x: number): string', gave the following error.
|
||||
!!! error TS2755: Argument of type 'string | number' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Type 'string' is not assignable to type 'number'.
|
||||
x;
|
||||
}
|
||||
x;
|
||||
|
@ -68,12 +80,12 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error
|
|||
x = foo(x);
|
||||
~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:45:17: Overload 1 of 2, '(x: string): number', gave the following error.
|
||||
Argument of type 'string | number' is not assignable to parameter of type 'string'.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts:45:17: Overload 2 of 2, '(x: number): string', gave the following error.
|
||||
Argument of type 'string | number' is not assignable to parameter of type 'number'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
!!! error TS2755: Overload 1 of 2, '(x: string): number', gave the following error.
|
||||
!!! error TS2755: Argument of type 'string | number' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Type 'number' is not assignable to type 'string'.
|
||||
!!! error TS2755: Overload 2 of 2, '(x: number): string', gave the following error.
|
||||
!!! error TS2755: Argument of type 'string | number' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Type 'string' is not assignable to type 'number'.
|
||||
}
|
||||
x;
|
||||
}
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,11): error TS2755: No overload matches this call.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/for-ofStatements/for-of39.ts (1 errors) ====
|
||||
var map = new Map([["", true], ["", 0]]);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/es6/for-ofStatements/for-of39.ts:1:19: Overload 1 of 3, '(iterable: Iterable<readonly [string, boolean]>): Map<string, boolean>', gave the following error.
|
||||
Overload 1 of 3, '(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]>'.
|
||||
Types of property '[Symbol.iterator]' are incompatible.
|
||||
Type '() => IterableIterator<[string, number] | [string, true]>' is not assignable to type '() => Iterator<readonly [string, boolean]>'.
|
||||
|
@ -17,8 +11,28 @@ tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,11): error TS2755: No
|
|||
Type '[string, number]' is not assignable to type 'readonly [string, boolean]'.
|
||||
Types of property '1' are incompatible.
|
||||
Type 'number' is not assignable to type 'boolean'.
|
||||
!!! related TS2760 tests/cases/conformance/es6/for-ofStatements/for-of39.ts:1:37: Overload 2 of 3, '(entries?: readonly (readonly [string, boolean])[]): Map<string, boolean>', gave the following error.
|
||||
Overload 2 of 3, '(entries?: readonly (readonly [string, boolean])[]): Map<string, boolean>', gave the following error.
|
||||
Type 'number' is not assignable to type 'boolean'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/for-ofStatements/for-of39.ts (1 errors) ====
|
||||
var map = new Map([["", true], ["", 0]]);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! error TS2755: Overload 1 of 3, '(iterable: Iterable<readonly [string, boolean]>): Map<string, boolean>', gave the following error.
|
||||
!!! error TS2755: Argument of type '([string, number] | [string, true])[]' is not assignable to parameter of type 'Iterable<readonly [string, boolean]>'.
|
||||
!!! error TS2755: Types of property '[Symbol.iterator]' are incompatible.
|
||||
!!! error TS2755: Type '() => IterableIterator<[string, number] | [string, true]>' is not assignable to type '() => Iterator<readonly [string, boolean]>'.
|
||||
!!! error TS2755: Type 'IterableIterator<[string, number] | [string, true]>' is not assignable to type 'Iterator<readonly [string, boolean]>'.
|
||||
!!! error TS2755: Types of property 'next' are incompatible.
|
||||
!!! error TS2755: Type '(value?: any) => IteratorResult<[string, number] | [string, true]>' is not assignable to type '(value?: any) => IteratorResult<readonly [string, boolean]>'.
|
||||
!!! error TS2755: Type 'IteratorResult<[string, number] | [string, true]>' is not assignable to type 'IteratorResult<readonly [string, boolean]>'.
|
||||
!!! error TS2755: Type '[string, number] | [string, true]' is not assignable to type 'readonly [string, boolean]'.
|
||||
!!! error TS2755: Type '[string, number]' is not assignable to type 'readonly [string, boolean]'.
|
||||
!!! error TS2755: Types of property '1' are incompatible.
|
||||
!!! error TS2755: Type 'number' is not assignable to type 'boolean'.
|
||||
!!! error TS2755: Overload 2 of 3, '(entries?: readonly (readonly [string, boolean])[]): Map<string, boolean>', gave the following error.
|
||||
!!! error TS2755: Type 'number' is not assignable to type 'boolean'.
|
||||
for (var [k, v] of map) {
|
||||
k;
|
||||
v;
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
tests/cases/compiler/functionOverloads2.ts(4,9): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(bar: string): string', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
Overload 2 of 2, '(bar: number): number', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/functionOverloads2.ts (1 errors) ====
|
||||
|
@ -8,7 +12,7 @@ tests/cases/compiler/functionOverloads2.ts(4,9): error TS2755: No overload match
|
|||
var x = foo(true);
|
||||
~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/functionOverloads2.ts:4:13: Overload 1 of 2, '(bar: string): string', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
!!! related TS2760 tests/cases/compiler/functionOverloads2.ts:4:13: Overload 2 of 2, '(bar: number): number', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 1 of 2, '(bar: string): string', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 2 of 2, '(bar: number): number', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'.
|
|
@ -1,4 +1,8 @@
|
|||
tests/cases/compiler/functionOverloads40.ts(4,9): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error.
|
||||
Type 'string' is not assignable to type 'boolean'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/functionOverloads40.ts (1 errors) ====
|
||||
|
@ -8,8 +12,8 @@ tests/cases/compiler/functionOverloads40.ts(4,9): error TS2755: No overload matc
|
|||
var x = foo([{a:'bar'}]);
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/functionOverloads40.ts:4:15: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
!!! related TS2760 tests/cases/compiler/functionOverloads40.ts:4:15: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error.
|
||||
Type 'string' is not assignable to type 'boolean'.
|
||||
!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error.
|
||||
!!! error TS2755: Type 'string' is not assignable to type 'number'.
|
||||
!!! error TS2755: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error.
|
||||
!!! error TS2755: Type 'string' is not assignable to type 'boolean'.
|
||||
|
|
@ -1,4 +1,8 @@
|
|||
tests/cases/compiler/functionOverloads41.ts(4,9): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error.
|
||||
Property 'a' is missing in type '{}' but required in type '{ a: number; }'.
|
||||
Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error.
|
||||
Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/functionOverloads41.ts (1 errors) ====
|
||||
|
@ -8,8 +12,8 @@ tests/cases/compiler/functionOverloads41.ts(4,9): error TS2755: No overload matc
|
|||
var x = foo([{}]);
|
||||
~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/functionOverloads41.ts:4:14: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error.
|
||||
Property 'a' is missing in type '{}' but required in type '{ a: number; }'.
|
||||
!!! related TS2760 tests/cases/compiler/functionOverloads41.ts:4:14: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error.
|
||||
Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'.
|
||||
!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error.
|
||||
!!! error TS2755: Property 'a' is missing in type '{}' but required in type '{ a: number; }'.
|
||||
!!! error TS2755: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error.
|
||||
!!! error TS2755: Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'.
|
||||
|
|
@ -2,8 +2,32 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl
|
|||
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(52,22): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(cb: (x: number) => Promise<string>): Promise<string>', gave the following error.
|
||||
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
|
||||
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
Overload 2 of 2, '(cb: (x: number) => Promise<string>, error?: (error: any) => Promise<string>): Promise<string>', gave the following error.
|
||||
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
|
||||
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(68,22): error TS2755: No overload matches this call.
|
||||
Overload 1 of 3, '(cb: (x: number) => Promise<string>): Promise<string>', gave the following error.
|
||||
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
|
||||
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
Overload 2 of 3, '(cb: (x: number) => Promise<string>, error?: (error: any) => Promise<string>): Promise<string>', gave the following error.
|
||||
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
|
||||
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
|
||||
Overload 3 of 3, '(cb: (x: number) => Promise<string>, error?: (error: any) => string, progress?: (preservation: any) => void): Promise<string>', gave the following error.
|
||||
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
|
||||
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(84,22): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(cb: (x: number) => Promise<boolean>): Promise<boolean>', gave the following error.
|
||||
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; (b: boolean): Promise<boolean>; }' is not assignable to parameter of type '(x: number) => Promise<boolean>'.
|
||||
Type 'Promise<number>' is not assignable to type 'Promise<boolean>'.
|
||||
Type 'number' is not assignable to type 'boolean'.
|
||||
Overload 2 of 2, '(cb: (x: number) => Promise<boolean>, error?: (error: any) => Promise<boolean>): Promise<boolean>', gave the following error.
|
||||
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; (b: boolean): Promise<boolean>; }' is not assignable to parameter of type '(x: number) => Promise<boolean>'.
|
||||
Type 'Promise<number>' is not assignable to type 'Promise<boolean>'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts (4 errors) ====
|
||||
|
@ -65,13 +89,13 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl
|
|||
var newPromise = numPromise.then(testFunction);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:52:38: Overload 1 of 2, '(cb: (x: number) => Promise<string>): Promise<string>', gave the following error.
|
||||
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
|
||||
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:52:38: Overload 2 of 2, '(cb: (x: number) => Promise<string>, error?: (error: any) => Promise<string>): Promise<string>', gave the following error.
|
||||
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
|
||||
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
|
||||
!!! error TS2755: Overload 1 of 2, '(cb: (x: number) => Promise<string>): Promise<string>', gave the following error.
|
||||
!!! error TS2755: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
|
||||
!!! error TS2755: Type 'Promise<number>' is not assignable to type 'Promise<string>'.
|
||||
!!! error TS2755: Type 'number' is not assignable to type 'string'.
|
||||
!!! error TS2755: Overload 2 of 2, '(cb: (x: number) => Promise<string>, error?: (error: any) => Promise<string>): Promise<string>', gave the following error.
|
||||
!!! error TS2755: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
|
||||
!!! error TS2755: Type 'Promise<number>' is not assignable to type 'Promise<string>'.
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
|
@ -90,16 +114,16 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl
|
|||
var newPromise = numPromise.then(testFunction);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 1 of 3, '(cb: (x: number) => Promise<string>): Promise<string>', gave the following error.
|
||||
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
|
||||
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 2 of 3, '(cb: (x: number) => Promise<string>, error?: (error: any) => Promise<string>): Promise<string>', gave the following error.
|
||||
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
|
||||
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
|
||||
!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:68:38: Overload 3 of 3, '(cb: (x: number) => Promise<string>, error?: (error: any) => string, progress?: (preservation: any) => void): Promise<string>', gave the following error.
|
||||
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
|
||||
Type 'Promise<number>' is not assignable to type 'Promise<string>'.
|
||||
!!! error TS2755: Overload 1 of 3, '(cb: (x: number) => Promise<string>): Promise<string>', gave the following error.
|
||||
!!! error TS2755: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
|
||||
!!! error TS2755: Type 'Promise<number>' is not assignable to type 'Promise<string>'.
|
||||
!!! error TS2755: Type 'number' is not assignable to type 'string'.
|
||||
!!! error TS2755: Overload 2 of 3, '(cb: (x: number) => Promise<string>, error?: (error: any) => Promise<string>): Promise<string>', gave the following error.
|
||||
!!! error TS2755: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
|
||||
!!! error TS2755: Type 'Promise<number>' is not assignable to type 'Promise<string>'.
|
||||
!!! error TS2755: Overload 3 of 3, '(cb: (x: number) => Promise<string>, error?: (error: any) => string, progress?: (preservation: any) => void): Promise<string>', gave the following error.
|
||||
!!! error TS2755: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
|
||||
!!! error TS2755: Type 'Promise<number>' is not assignable to type 'Promise<string>'.
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
|
@ -118,12 +142,12 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverl
|
|||
var newPromise = numPromise.then(testFunction);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:84:38: Overload 1 of 2, '(cb: (x: number) => Promise<boolean>): Promise<boolean>', gave the following error.
|
||||
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; (b: boolean): Promise<boolean>; }' is not assignable to parameter of type '(x: number) => Promise<boolean>'.
|
||||
Type 'Promise<number>' is not assignable to type 'Promise<boolean>'.
|
||||
Type 'number' is not assignable to type 'boolean'.
|
||||
!!! related TS2760 tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts:84:38: Overload 2 of 2, '(cb: (x: number) => Promise<boolean>, error?: (error: any) => Promise<boolean>): Promise<boolean>', gave the following error.
|
||||
Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; (b: boolean): Promise<boolean>; }' is not assignable to parameter of type '(x: number) => Promise<boolean>'.
|
||||
Type 'Promise<number>' is not assignable to type 'Promise<boolean>'.
|
||||
!!! error TS2755: Overload 1 of 2, '(cb: (x: number) => Promise<boolean>): Promise<boolean>', gave the following error.
|
||||
!!! error TS2755: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; (b: boolean): Promise<boolean>; }' is not assignable to parameter of type '(x: number) => Promise<boolean>'.
|
||||
!!! error TS2755: Type 'Promise<number>' is not assignable to type 'Promise<boolean>'.
|
||||
!!! error TS2755: Type 'number' is not assignable to type 'boolean'.
|
||||
!!! error TS2755: Overload 2 of 2, '(cb: (x: number) => Promise<boolean>, error?: (error: any) => Promise<boolean>): Promise<boolean>', gave the following error.
|
||||
!!! error TS2755: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; (b: boolean): Promise<boolean>; }' is not assignable to parameter of type '(x: number) => Promise<boolean>'.
|
||||
!!! error TS2755: Type 'Promise<number>' is not assignable to type 'Promise<boolean>'.
|
||||
}
|
||||
|
|
@ -1,4 +1,6 @@
|
|||
tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(arg1: number[]): any', gave the following error.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/heterogeneousArrayAndOverloads.ts (1 errors) ====
|
||||
|
@ -13,7 +15,7 @@ tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,9): error TS2755: No ov
|
|||
this.test([1, 2, "hi", 5]); // Error
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/heterogeneousArrayAndOverloads.ts:9:26: Overload 1 of 2, '(arg1: number[]): any', gave the following error.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
!!! error TS2755: Overload 1 of 2, '(arg1: number[]): any', gave the following error.
|
||||
!!! error TS2755: Type 'string' is not assignable to type 'number'.
|
||||
}
|
||||
}
|
|
@ -10,7 +10,23 @@ tests/cases/compiler/incompatibleTypes.ts(26,12): error TS2416: Property 'p1' in
|
|||
tests/cases/compiler/incompatibleTypes.ts(34,12): error TS2416: Property 'p1' in type 'C4' is not assignable to the same property in base type 'IFoo4'.
|
||||
Type '{ c: { b: string; }; d: string; }' is missing the following properties from type '{ a: { a: string; }; b: string; }': a, b
|
||||
tests/cases/compiler/incompatibleTypes.ts(42,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(i: IFoo1): void', gave the following error.
|
||||
Argument of type 'C1' is not assignable to parameter of type 'IFoo1'.
|
||||
Types of property 'p1' are incompatible.
|
||||
Type '() => string' is not assignable to type '() => number'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
Overload 2 of 2, '(i: IFoo2): void', gave the following error.
|
||||
Argument of type 'C1' is not assignable to parameter of type 'IFoo2'.
|
||||
Types of property 'p1' are incompatible.
|
||||
Type '() => string' is not assignable to type '(s: string) => number'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/compiler/incompatibleTypes.ts(49,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error.
|
||||
Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ a: { a: string; }; b: string; }'.
|
||||
Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'.
|
||||
Overload 2 of 2, '(s: { c: { b: string; }; d: string; }): string', gave the following error.
|
||||
Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'.
|
||||
Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'.
|
||||
tests/cases/compiler/incompatibleTypes.ts(66,47): error TS2322: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }'.
|
||||
Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'.
|
||||
tests/cases/compiler/incompatibleTypes.ts(72,5): error TS2322: Type '5' is not assignable to type '() => string'.
|
||||
|
@ -77,16 +93,16 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) =>
|
|||
if1(c1);
|
||||
~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/incompatibleTypes.ts:42:5: Overload 1 of 2, '(i: IFoo1): void', gave the following error.
|
||||
Argument of type 'C1' is not assignable to parameter of type 'IFoo1'.
|
||||
Types of property 'p1' are incompatible.
|
||||
Type '() => string' is not assignable to type '() => number'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
!!! related TS2760 tests/cases/compiler/incompatibleTypes.ts:42:5: Overload 2 of 2, '(i: IFoo2): void', gave the following error.
|
||||
Argument of type 'C1' is not assignable to parameter of type 'IFoo2'.
|
||||
Types of property 'p1' are incompatible.
|
||||
Type '() => string' is not assignable to type '(s: string) => number'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
!!! error TS2755: Overload 1 of 2, '(i: IFoo1): void', gave the following error.
|
||||
!!! error TS2755: Argument of type 'C1' is not assignable to parameter of type 'IFoo1'.
|
||||
!!! error TS2755: Types of property 'p1' are incompatible.
|
||||
!!! error TS2755: Type '() => string' is not assignable to type '() => number'.
|
||||
!!! error TS2755: Type 'string' is not assignable to type 'number'.
|
||||
!!! error TS2755: Overload 2 of 2, '(i: IFoo2): void', gave the following error.
|
||||
!!! error TS2755: Argument of type 'C1' is not assignable to parameter of type 'IFoo2'.
|
||||
!!! error TS2755: Types of property 'p1' are incompatible.
|
||||
!!! error TS2755: Type '() => string' is not assignable to type '(s: string) => number'.
|
||||
!!! error TS2755: Type 'string' is not assignable to type 'number'.
|
||||
|
||||
|
||||
function of1(n: { a: { a: string; }; b: string; }): number;
|
||||
|
@ -96,12 +112,12 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) =>
|
|||
of1({ e: 0, f: 0 });
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/incompatibleTypes.ts:49:7: Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error.
|
||||
Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ a: { a: string; }; b: string; }'.
|
||||
Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'.
|
||||
!!! related TS2760 tests/cases/compiler/incompatibleTypes.ts:49:7: Overload 2 of 2, '(s: { c: { b: string; }; d: string; }): string', gave the following error.
|
||||
Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'.
|
||||
Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'.
|
||||
!!! error TS2755: Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error.
|
||||
!!! error TS2755: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ a: { a: string; }; b: string; }'.
|
||||
!!! error TS2755: Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'.
|
||||
!!! error TS2755: Overload 2 of 2, '(s: { c: { b: string; }; d: string; }): string', gave the following error.
|
||||
!!! error TS2755: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'.
|
||||
!!! error TS2755: Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'.
|
||||
|
||||
interface IMap {
|
||||
[key:string]:string;
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
tests/cases/compiler/inheritedConstructorWithRestParams2.ts(32,13): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'.
|
||||
tests/cases/compiler/inheritedConstructorWithRestParams2.ts(33,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error.
|
||||
Argument of type '""' 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 '3' is not assignable to parameter of type 'string'.
|
||||
tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error.
|
||||
Argument of type '""' 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 '3' is not assignable to parameter of type 'string'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/inheritedConstructorWithRestParams2.ts (3 errors) ====
|
||||
|
@ -41,14 +49,14 @@ tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,1): error TS2755:
|
|||
new Derived("", 3, "", 3);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:33:20: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error.
|
||||
Argument of type '""' is not assignable to parameter of type 'number'.
|
||||
!!! related TS2760 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:33:17: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error.
|
||||
Argument of type '3' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error.
|
||||
!!! error TS2755: Argument of type '""' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error.
|
||||
!!! error TS2755: Argument of type '3' is not assignable to parameter of type 'string'.
|
||||
new Derived("", 3, "", "");
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:34:20: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error.
|
||||
Argument of type '""' is not assignable to parameter of type 'number'.
|
||||
!!! related TS2760 tests/cases/compiler/inheritedConstructorWithRestParams2.ts:34:17: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error.
|
||||
Argument of type '3' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error.
|
||||
!!! error TS2755: Argument of type '""' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error.
|
||||
!!! error TS2755: Argument of type '3' is not assignable to parameter of type 'string'.
|
|
@ -1,12 +1,5 @@
|
|||
tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,24): error TS2755: No overload matches this call.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts (1 errors) ====
|
||||
function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { }
|
||||
takeFirstTwoEntries(...new Map([["", 0], ["hello", true]]));
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts:2:32: Overload 1 of 3, '(iterable: Iterable<readonly [string, number]>): Map<string, number>', gave the following error.
|
||||
Overload 1 of 3, '(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]>'.
|
||||
Types of property '[Symbol.iterator]' are incompatible.
|
||||
Type '() => IterableIterator<[string, number] | [string, boolean]>' is not assignable to type '() => Iterator<readonly [string, number]>'.
|
||||
|
@ -18,5 +11,26 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,24): error
|
|||
Type '[string, boolean]' is not assignable to type 'readonly [string, number]'.
|
||||
Types of property '1' are incompatible.
|
||||
Type 'boolean' is not assignable to type 'number'.
|
||||
!!! related TS2760 tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts:2:52: Overload 2 of 3, '(entries?: readonly (readonly [string, number])[]): Map<string, number>', gave the following error.
|
||||
Overload 2 of 3, '(entries?: readonly (readonly [string, number])[]): Map<string, number>', gave the following error.
|
||||
Type 'true' is not assignable to type 'number'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts (1 errors) ====
|
||||
function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { }
|
||||
takeFirstTwoEntries(...new Map([["", 0], ["hello", true]]));
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! error TS2755: Overload 1 of 3, '(iterable: Iterable<readonly [string, number]>): Map<string, number>', gave the following error.
|
||||
!!! error TS2755: Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable<readonly [string, number]>'.
|
||||
!!! error TS2755: Types of property '[Symbol.iterator]' are incompatible.
|
||||
!!! error TS2755: Type '() => IterableIterator<[string, number] | [string, boolean]>' is not assignable to type '() => Iterator<readonly [string, number]>'.
|
||||
!!! error TS2755: Type 'IterableIterator<[string, number] | [string, boolean]>' is not assignable to type 'Iterator<readonly [string, number]>'.
|
||||
!!! error TS2755: Types of property 'next' are incompatible.
|
||||
!!! error TS2755: Type '(value?: any) => IteratorResult<[string, number] | [string, boolean]>' is not assignable to type '(value?: any) => IteratorResult<readonly [string, number]>'.
|
||||
!!! error TS2755: Type 'IteratorResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult<readonly [string, number]>'.
|
||||
!!! error TS2755: Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'.
|
||||
!!! error TS2755: Type '[string, boolean]' is not assignable to type 'readonly [string, number]'.
|
||||
!!! error TS2755: Types of property '1' are incompatible.
|
||||
!!! error TS2755: Type 'boolean' is not assignable to type 'number'.
|
||||
!!! error TS2755: Overload 2 of 3, '(entries?: readonly (readonly [string, number])[]): Map<string, number>', gave the following error.
|
||||
!!! error TS2755: Type 'true' is not assignable to type 'number'.
|
|
@ -1,4 +1,13 @@
|
|||
tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(...items: ConcatArray<number>[]): number[]', gave the following error.
|
||||
Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray<number>'.
|
||||
Types of property 'slice' are incompatible.
|
||||
Type '(start?: number, end?: number) => symbol[]' is not assignable to type '(start?: number, end?: number) => number[]'.
|
||||
Type 'symbol[]' is not assignable to type 'number[]'.
|
||||
Type 'symbol' is not assignable to type 'number'.
|
||||
Overload 2 of 2, '(...items: (number | ConcatArray<number>)[]): number[]', gave the following error.
|
||||
Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray<number>'.
|
||||
Type 'symbol[]' is not assignable to type 'ConcatArray<number>'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts (1 errors) ====
|
||||
|
@ -19,12 +28,12 @@ tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,1): error TS2755
|
|||
array.concat([...new SymbolIterator]);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts:15:14: Overload 1 of 2, '(...items: ConcatArray<number>[]): number[]', gave the following error.
|
||||
Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray<number>'.
|
||||
Types of property 'slice' are incompatible.
|
||||
Type '(start?: number, end?: number) => symbol[]' is not assignable to type '(start?: number, end?: number) => number[]'.
|
||||
Type 'symbol[]' is not assignable to type 'number[]'.
|
||||
Type 'symbol' is not assignable to type 'number'.
|
||||
!!! related TS2760 tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts:15:14: Overload 2 of 2, '(...items: (number | ConcatArray<number>)[]): number[]', gave the following error.
|
||||
Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray<number>'.
|
||||
Type 'symbol[]' is not assignable to type 'ConcatArray<number>'.
|
||||
!!! error TS2755: Overload 1 of 2, '(...items: ConcatArray<number>[]): number[]', gave the following error.
|
||||
!!! error TS2755: Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray<number>'.
|
||||
!!! error TS2755: Types of property 'slice' are incompatible.
|
||||
!!! error TS2755: Type '(start?: number, end?: number) => symbol[]' is not assignable to type '(start?: number, end?: number) => number[]'.
|
||||
!!! error TS2755: Type 'symbol[]' is not assignable to type 'number[]'.
|
||||
!!! error TS2755: Type 'symbol' is not assignable to type 'number'.
|
||||
!!! error TS2755: Overload 2 of 2, '(...items: (number | ConcatArray<number>)[]): number[]', gave the following error.
|
||||
!!! error TS2755: Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray<number>'.
|
||||
!!! error TS2755: Type 'symbol[]' is not assignable to type 'ConcatArray<number>'.
|
|
@ -1,6 +1,18 @@
|
|||
tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(19,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(x: { s: string; }): string', gave the following error.
|
||||
Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'.
|
||||
Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'.
|
||||
Overload 2 of 2, '(x: { n: number; }): number', gave the following error.
|
||||
Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'.
|
||||
Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'.
|
||||
tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(22,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'w' must be of type 'A', but here has type 'C'.
|
||||
tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(x: { s: string; }): string', gave the following error.
|
||||
Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'.
|
||||
Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'.
|
||||
Overload 2 of 2, '(x: { n: number; }): number', gave the following error.
|
||||
Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'.
|
||||
Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts (3 errors) ====
|
||||
|
@ -25,12 +37,12 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS275
|
|||
v({ s: "", n: 0 }).toLowerCase();
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:19:12: Overload 1 of 2, '(x: { s: string; }): string', gave the following error.
|
||||
Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'.
|
||||
Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'.
|
||||
!!! related TS2760 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:19:5: Overload 2 of 2, '(x: { n: number; }): number', gave the following error.
|
||||
Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'.
|
||||
Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'.
|
||||
!!! error TS2755: Overload 1 of 2, '(x: { s: string; }): string', gave the following error.
|
||||
!!! error TS2755: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'.
|
||||
!!! error TS2755: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'.
|
||||
!!! error TS2755: Overload 2 of 2, '(x: { n: number; }): number', gave the following error.
|
||||
!!! error TS2755: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'.
|
||||
!!! error TS2755: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'.
|
||||
|
||||
var w: A;
|
||||
var w: C;
|
||||
|
@ -41,9 +53,9 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,1): error TS275
|
|||
w({ s: "", n: 0 }).toLowerCase();
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:24:12: Overload 1 of 2, '(x: { s: string; }): string', gave the following error.
|
||||
Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'.
|
||||
Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'.
|
||||
!!! related TS2760 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:24:5: Overload 2 of 2, '(x: { n: number; }): number', gave the following error.
|
||||
Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'.
|
||||
Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'.
|
||||
!!! error TS2755: Overload 1 of 2, '(x: { s: string; }): string', gave the following error.
|
||||
!!! error TS2755: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ s: string; }'.
|
||||
!!! error TS2755: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'.
|
||||
!!! error TS2755: Overload 2 of 2, '(x: { n: number; }): number', gave the following error.
|
||||
!!! error TS2755: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'.
|
||||
!!! error TS2755: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'.
|
|
@ -4,6 +4,10 @@ tests/cases/compiler/overload1.ts(31,11): error TS2554: Expected 1-2 arguments,
|
|||
tests/cases/compiler/overload1.ts(32,5): error TS2554: Expected 1-2 arguments, but got 0.
|
||||
tests/cases/compiler/overload1.ts(33,1): error TS2322: Type 'C' is not assignable to type 'string'.
|
||||
tests/cases/compiler/overload1.ts(34,3): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(s1: string, s2: number): string', gave the following error.
|
||||
Argument of type '2' is not assignable to parameter of type 'string'.
|
||||
Overload 2 of 2, '(s1: number, s2: string): number', gave the following error.
|
||||
Argument of type '2' is not assignable to parameter of type 'string'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/overload1.ts (6 errors) ====
|
||||
|
@ -54,10 +58,10 @@ tests/cases/compiler/overload1.ts(34,3): error TS2755: No overload matches this
|
|||
z=x.h(2,2); // no match
|
||||
~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/overload1.ts:34:7: Overload 1 of 2, '(s1: string, s2: number): string', gave the following error.
|
||||
Argument of type '2' is not assignable to parameter of type 'string'.
|
||||
!!! related TS2760 tests/cases/compiler/overload1.ts:34:9: Overload 2 of 2, '(s1: number, s2: string): number', gave the following error.
|
||||
Argument of type '2' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 1 of 2, '(s1: string, s2: number): string', gave the following error.
|
||||
!!! error TS2755: Argument of type '2' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 2 of 2, '(s1: number, s2: string): number', gave the following error.
|
||||
!!! error TS2755: Argument of type '2' is not assignable to parameter of type 'string'.
|
||||
z=x.h("hello",0); // good
|
||||
|
||||
var v=x.g;
|
||||
|
|
|
@ -1,11 +1,23 @@
|
|||
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(s: string): string', gave the following error.
|
||||
Argument of type '{}' is not assignable to parameter of type 'string'.
|
||||
Overload 2 of 2, '(s: number): number', gave the following error.
|
||||
Argument of type '{}' is not assignable to parameter of type 'number'.
|
||||
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(41,11): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'.
|
||||
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): error TS2558: Expected 3 type arguments, but got 4.
|
||||
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(70,21): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'.
|
||||
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,21): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'.
|
||||
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(81,5): error TS2344: Type 'boolean' does not satisfy the constraint 'number'.
|
||||
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(84,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(n: string, m: any): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
Overload 2 of 2, '(n: number, m: any): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(85,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(n: any, m: number): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
Overload 2 of 2, '(n: any, m: string): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'.
|
||||
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): error TS2339: Property 'toFixed' does not exist on type 'string'.
|
||||
|
||||
|
@ -40,10 +52,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22):
|
|||
fn1({}); // Error
|
||||
~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:27:5: Overload 1 of 2, '(s: string): string', gave the following error.
|
||||
Argument of type '{}' is not assignable to parameter of type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:27:5: Overload 2 of 2, '(s: number): number', gave the following error.
|
||||
Argument of type '{}' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 1 of 2, '(s: string): string', gave the following error.
|
||||
!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 2 of 2, '(s: number): number', gave the following error.
|
||||
!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'number'.
|
||||
|
||||
// Generic and non - generic overload where generic overload is the only candidate when called with type arguments
|
||||
function fn2(s: string, n: number): number;
|
||||
|
@ -113,17 +125,17 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22):
|
|||
fn4(true, null); // Error
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:84:5: Overload 1 of 2, '(n: string, m: any): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:84:5: Overload 2 of 2, '(n: number, m: any): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 1 of 2, '(n: string, m: any): any', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 2 of 2, '(n: number, m: any): any', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
fn4(null, true); // Error
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:85:11: Overload 1 of 2, '(n: any, m: number): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:85:11: Overload 2 of 2, '(n: any, m: string): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 1 of 2, '(n: any, m: number): any', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 2 of 2, '(n: any, m: string): any', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
|
||||
// Non - generic overloads where contextual typing of function arguments has errors
|
||||
function fn5(f: (n: string) => void): string;
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(27,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(s: string): fn1', gave the following error.
|
||||
Argument of type '{}' is not assignable to parameter of type 'string'.
|
||||
Overload 2 of 2, '(s: number): fn1', gave the following error.
|
||||
Argument of type '{}' is not assignable to parameter of type 'number'.
|
||||
tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(60,9): error TS2558: Expected 3 type arguments, but got 1.
|
||||
tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(61,9): error TS2558: Expected 3 type arguments, but got 2.
|
||||
tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(65,9): error TS2558: Expected 3 type arguments, but got 4.
|
||||
|
@ -44,10 +48,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru
|
|||
new fn1({}); // Error
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts:27:9: Overload 1 of 2, '(s: string): fn1', gave the following error.
|
||||
Argument of type '{}' is not assignable to parameter of type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts:27:9: Overload 2 of 2, '(s: number): fn1', gave the following error.
|
||||
Argument of type '{}' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 1 of 2, '(s: string): fn1', gave the following error.
|
||||
!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 2 of 2, '(s: number): fn1', gave the following error.
|
||||
!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'number'.
|
||||
|
||||
// Generic and non - generic overload where generic overload is the only candidate when called with type arguments
|
||||
class fn2<T> {
|
||||
|
|
|
@ -1,11 +1,23 @@
|
|||
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(s: string): string', gave the following error.
|
||||
Argument of type '{}' is not assignable to parameter of type 'string'.
|
||||
Overload 2 of 2, '(s: number): number', gave the following error.
|
||||
Argument of type '{}' is not assignable to parameter of type 'number'.
|
||||
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(43,15): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'.
|
||||
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,9): error TS2558: Expected 3 type arguments, but got 4.
|
||||
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(77,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'.
|
||||
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(78,25): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'.
|
||||
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(88,9): error TS2344: Type 'boolean' does not satisfy the constraint 'number'.
|
||||
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(91,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(n: string, m: any): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
Overload 2 of 2, '(n: number, m: any): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(92,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(n: any, m: number): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
Overload 2 of 2, '(n: any, m: string): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(100,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'.
|
||||
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(100,26): error TS2339: Property 'toFixed' does not exist on type 'string'.
|
||||
|
||||
|
@ -40,10 +52,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors
|
|||
new fn1({}); // Error
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:27:9: Overload 1 of 2, '(s: string): string', gave the following error.
|
||||
Argument of type '{}' is not assignable to parameter of type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:27:9: Overload 2 of 2, '(s: number): number', gave the following error.
|
||||
Argument of type '{}' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 1 of 2, '(s: string): string', gave the following error.
|
||||
!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 2 of 2, '(s: number): number', gave the following error.
|
||||
!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'number'.
|
||||
|
||||
// Generic and non - generic overload where generic overload is the only candidate when called with type arguments
|
||||
interface fn2 {
|
||||
|
@ -120,17 +132,17 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors
|
|||
new fn4(true, null); // Error
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:91:9: Overload 1 of 2, '(n: string, m: any): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:91:9: Overload 2 of 2, '(n: number, m: any): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 1 of 2, '(n: string, m: any): any', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 2 of 2, '(n: number, m: any): any', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
new fn4(null, true); // Error
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:92:15: Overload 1 of 2, '(n: any, m: number): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! related TS2760 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:92:15: Overload 2 of 2, '(n: any, m: string): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 1 of 2, '(n: any, m: number): any', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 2 of 2, '(n: any, m: string): any', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
|
||||
// Non - generic overloads where contextual typing of function arguments has errors
|
||||
interface fn5 {
|
||||
|
|
|
@ -1,6 +1,18 @@
|
|||
tests/cases/compiler/overloadResolutionTest1.ts(7,12): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error.
|
||||
Type 'string' is not assignable to type 'boolean'.
|
||||
tests/cases/compiler/overloadResolutionTest1.ts(18,10): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(bar: { a: number; }): string', gave the following error.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error.
|
||||
Type 'string' is not assignable to type 'boolean'.
|
||||
tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(bar: { a: number; }): number', gave the following error.
|
||||
Type 'true' is not assignable to type 'number'.
|
||||
Overload 2 of 2, '(bar: { a: string; }): string', gave the following error.
|
||||
Type 'true' is not assignable to type 'string'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/overloadResolutionTest1.ts (3 errors) ====
|
||||
|
@ -13,10 +25,10 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No overload
|
|||
var x111 = foo([{a:"s"}]); // error - does not match any signature
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:7:18: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:7:18: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error.
|
||||
Type 'string' is not assignable to type 'boolean'.
|
||||
!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error.
|
||||
!!! error TS2755: Type 'string' is not assignable to type 'number'.
|
||||
!!! error TS2755: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error.
|
||||
!!! error TS2755: Type 'string' is not assignable to type 'boolean'.
|
||||
var x1111 = foo([{a:null}]); // works - ambiguous call is resolved to be the first in the overload set so this returns a string
|
||||
|
||||
|
||||
|
@ -30,10 +42,10 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No overload
|
|||
var x4 = foo2({a:"s"}); // error
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:18:16: Overload 1 of 2, '(bar: { a: number; }): string', gave the following error.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:18:16: Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error.
|
||||
Type 'string' is not assignable to type 'boolean'.
|
||||
!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }): string', gave the following error.
|
||||
!!! error TS2755: Type 'string' is not assignable to type 'number'.
|
||||
!!! error TS2755: Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error.
|
||||
!!! error TS2755: Type 'string' is not assignable to type 'boolean'.
|
||||
|
||||
|
||||
function foo4(bar:{a:number;}):number;
|
||||
|
@ -42,7 +54,7 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,9): error TS2755: No overload
|
|||
var x = foo4({a:true}); // error
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:24:15: Overload 1 of 2, '(bar: { a: number; }): number', gave the following error.
|
||||
Type 'true' is not assignable to type 'number'.
|
||||
!!! related TS2760 tests/cases/compiler/overloadResolutionTest1.ts:24:15: Overload 2 of 2, '(bar: { a: string; }): string', gave the following error.
|
||||
Type 'true' is not assignable to type 'string'.
|
||||
!!! error TS2755: Overload 1 of 2, '(bar: { a: number; }): number', gave the following error.
|
||||
!!! error TS2755: Type 'true' is not assignable to type 'number'.
|
||||
!!! error TS2755: Overload 2 of 2, '(bar: { a: string; }): string', gave the following error.
|
||||
!!! error TS2755: Type 'true' is not assignable to type 'string'.
|
|
@ -1,5 +1,9 @@
|
|||
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,9): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(x: "hi", items: string[]): D', gave the following error.
|
||||
Argument of type '"um"' is not assignable to parameter of type '"hi"'.
|
||||
Overload 2 of 2, '(x: "bye", items: string[]): E', gave the following error.
|
||||
Argument of type '"um"' is not assignable to parameter of type '"bye"'.
|
||||
tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2394: This overload signature is not compatible with its implementation signature.
|
||||
|
||||
|
||||
|
@ -24,10 +28,10 @@ tests/cases/compiler/overloadingOnConstants2.ts(19,10): error TS2394: This overl
|
|||
var c = foo("um", []); // error
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/overloadingOnConstants2.ts:15:13: Overload 1 of 2, '(x: "hi", items: string[]): D', gave the following error.
|
||||
Argument of type '"um"' is not assignable to parameter of type '"hi"'.
|
||||
!!! related TS2760 tests/cases/compiler/overloadingOnConstants2.ts:15:13: Overload 2 of 2, '(x: "bye", items: string[]): E', gave the following error.
|
||||
Argument of type '"um"' is not assignable to parameter of type '"bye"'.
|
||||
!!! error TS2755: Overload 1 of 2, '(x: "hi", items: string[]): D', gave the following error.
|
||||
!!! error TS2755: Argument of type '"um"' is not assignable to parameter of type '"hi"'.
|
||||
!!! error TS2755: Overload 2 of 2, '(x: "bye", items: string[]): E', gave the following error.
|
||||
!!! error TS2755: Argument of type '"um"' is not assignable to parameter of type '"bye"'.
|
||||
|
||||
|
||||
//function bar(x: "hi", items: string[]): D;
|
||||
|
|
|
@ -4,6 +4,17 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(14,37):
|
|||
tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,5): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,38): error TS2344: Type 'D' does not satisfy the constraint 'A'.
|
||||
tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(18,23): error TS2755: No overload matches this call.
|
||||
Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error.
|
||||
Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: D) => number'.
|
||||
Type 'G<D>' is not assignable to type 'number'.
|
||||
Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error.
|
||||
Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: C) => any'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Property 'q' is missing in type 'C' but required in type 'D'.
|
||||
Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error.
|
||||
Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: B) => any'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Property 'q' is missing in type 'B' but required in type 'D'.
|
||||
tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14): error TS2344: Type 'D' does not satisfy the constraint 'A'.
|
||||
|
||||
|
||||
|
@ -46,15 +57,15 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,14):
|
|||
});
|
||||
~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:18:27: Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error.
|
||||
Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: D) => number'.
|
||||
Type 'G<D>' is not assignable to type 'number'.
|
||||
!!! related TS2760 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:18:27: Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error.
|
||||
Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: C) => any'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Property 'q' is missing in type 'C' but required in type 'D'.
|
||||
!!! related TS2760 tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts:18:27: Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error.
|
||||
Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: B) => any'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Property 'q' is missing in type 'B' but required in type 'D'.
|
||||
!!! error TS2755: Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error.
|
||||
!!! error TS2755: Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: D) => number'.
|
||||
!!! error TS2755: Type 'G<D>' is not assignable to type 'number'.
|
||||
!!! error TS2755: Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error.
|
||||
!!! error TS2755: Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: C) => any'.
|
||||
!!! error TS2755: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2755: Property 'q' is missing in type 'C' but required in type 'D'.
|
||||
!!! error TS2755: Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error.
|
||||
!!! error TS2755: Argument of type '(x: D) => G<D>' is not assignable to parameter of type '(x: B) => any'.
|
||||
!!! error TS2755: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2755: Property 'q' is missing in type 'B' but required in type 'D'.
|
||||
|
|
@ -1,6 +1,14 @@
|
|||
tests/cases/compiler/overloadsWithProvisionalErrors.ts(6,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(s: string): number', gave the following error.
|
||||
Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'.
|
||||
Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error.
|
||||
Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b
|
||||
tests/cases/compiler/overloadsWithProvisionalErrors.ts(7,17): error TS2304: Cannot find name 'blah'.
|
||||
tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(s: string): number', gave the following error.
|
||||
Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'.
|
||||
Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error.
|
||||
Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'.
|
||||
tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cannot find name 'blah'.
|
||||
|
||||
|
||||
|
@ -13,19 +21,19 @@ tests/cases/compiler/overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cann
|
|||
func(s => ({})); // Error for no applicable overload (object type is missing a and b)
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/overloadsWithProvisionalErrors.ts:6:6: Overload 1 of 2, '(s: string): number', gave the following error.
|
||||
Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'.
|
||||
!!! related TS2760 tests/cases/compiler/overloadsWithProvisionalErrors.ts:6:11: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error.
|
||||
Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b
|
||||
!!! error TS2755: Overload 1 of 2, '(s: string): number', gave the following error.
|
||||
!!! error TS2755: Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error.
|
||||
!!! error TS2755: Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b
|
||||
func(s => ({ a: blah, b: 3 })); // Only error inside the function, but not outside (since it would be applicable if not for the provisional error)
|
||||
~~~~
|
||||
!!! 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 TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/overloadsWithProvisionalErrors.ts:8:6: Overload 1 of 2, '(s: string): number', gave the following error.
|
||||
Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'.
|
||||
!!! related TS2760 tests/cases/compiler/overloadsWithProvisionalErrors.ts:8:11: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error.
|
||||
Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'.
|
||||
!!! error TS2755: Overload 1 of 2, '(s: string): number', gave the following error.
|
||||
!!! error TS2755: Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error.
|
||||
!!! error TS2755: Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'.
|
||||
~~~~
|
||||
!!! error TS2304: Cannot find name 'blah'.
|
|
@ -1,4 +1,14 @@
|
|||
tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(success?: (value: string) => Promise<unknown>): Promise<unknown>', gave the following error.
|
||||
Property 'catch' is missing in type 'IPromise<number>' but required in type 'Promise<unknown>'.
|
||||
Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike<number>, onrejected?: (reason: any) => PromiseLike<never>): Promise<number>', gave the following error.
|
||||
Type 'IPromise<number>' is not assignable to type 'number | PromiseLike<number>'.
|
||||
Type 'IPromise<number>' is not assignable to type 'PromiseLike<number>'.
|
||||
Types of property 'then' are incompatible.
|
||||
Type '<U>(success?: (value: number) => IPromise<U>) => IPromise<U>' is not assignable to type '<TResult1 = number, TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => PromiseLike<TResult1 | TResult2>'.
|
||||
Types of parameters 'success' and 'onfulfilled' are incompatible.
|
||||
Type 'TResult1 | PromiseLike<TResult1>' is not assignable to type 'IPromise<TResult1 | TResult2>'.
|
||||
Type 'TResult1' is not assignable to type 'IPromise<TResult1 | TResult2>'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/promiseTypeInference.ts (1 errors) ====
|
||||
|
@ -14,14 +24,14 @@ tests/cases/compiler/promiseTypeInference.ts(10,11): error TS2755: No overload m
|
|||
var $$x = load("something").then(s => convert(s));
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/promiseTypeInference.ts:10:39: Overload 1 of 2, '(success?: (value: string) => Promise<unknown>): Promise<unknown>', gave the following error.
|
||||
Property 'catch' is missing in type 'IPromise<number>' but required in type 'Promise<unknown>'.
|
||||
!!! related TS2760 tests/cases/compiler/promiseTypeInference.ts:10:39: Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike<number>, onrejected?: (reason: any) => PromiseLike<never>): Promise<number>', gave the following error.
|
||||
Type 'IPromise<number>' is not assignable to type 'number | PromiseLike<number>'.
|
||||
Type 'IPromise<number>' is not assignable to type 'PromiseLike<number>'.
|
||||
Types of property 'then' are incompatible.
|
||||
Type '<U>(success?: (value: number) => IPromise<U>) => IPromise<U>' is not assignable to type '<TResult1 = number, TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => PromiseLike<TResult1 | TResult2>'.
|
||||
Types of parameters 'success' and 'onfulfilled' are incompatible.
|
||||
Type 'TResult1 | PromiseLike<TResult1>' is not assignable to type 'IPromise<TResult1 | TResult2>'.
|
||||
Type 'TResult1' is not assignable to type 'IPromise<TResult1 | TResult2>'.
|
||||
!!! error TS2755: Overload 1 of 2, '(success?: (value: string) => Promise<unknown>): Promise<unknown>', gave the following error.
|
||||
!!! error TS2755: Property 'catch' is missing in type 'IPromise<number>' but required in type 'Promise<unknown>'.
|
||||
!!! error TS2755: Overload 2 of 2, '(onfulfilled?: (value: string) => number | PromiseLike<number>, onrejected?: (reason: any) => PromiseLike<never>): Promise<number>', gave the following error.
|
||||
!!! error TS2755: Type 'IPromise<number>' is not assignable to type 'number | PromiseLike<number>'.
|
||||
!!! error TS2755: Type 'IPromise<number>' is not assignable to type 'PromiseLike<number>'.
|
||||
!!! error TS2755: Types of property 'then' are incompatible.
|
||||
!!! error TS2755: Type '<U>(success?: (value: number) => IPromise<U>) => IPromise<U>' is not assignable to type '<TResult1 = number, TResult2 = never>(onfulfilled?: (value: number) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => PromiseLike<TResult1 | TResult2>'.
|
||||
!!! error TS2755: Types of parameters 'success' and 'onfulfilled' are incompatible.
|
||||
!!! error TS2755: Type 'TResult1 | PromiseLike<TResult1>' is not assignable to type 'IPromise<TResult1 | TResult2>'.
|
||||
!!! error TS2755: Type 'TResult1' is not assignable to type 'IPromise<TResult1 | TResult2>'.
|
||||
|
|
@ -12,6 +12,12 @@ tests/cases/compiler/recursiveFunctionTypes.ts(33,8): error TS2554: Expected 0-1
|
|||
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,8): error TS2554: Expected 0-1 arguments, but got 2.
|
||||
tests/cases/compiler/recursiveFunctionTypes.ts(43,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 4, '(a: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): () => number', gave the following error.
|
||||
Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'.
|
||||
Overload 2 of 4, '(a: number): number', gave the following error.
|
||||
Argument of type '""' is not assignable to parameter of type 'number'.
|
||||
Overload 3 of 4, '(a?: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }', gave the following error.
|
||||
Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/recursiveFunctionTypes.ts (13 errors) ====
|
||||
|
@ -86,10 +92,10 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,1): error TS2755: No overload
|
|||
f7(""); // ok (function takes an any param)
|
||||
~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/recursiveFunctionTypes.ts:43:4: Overload 1 of 4, '(a: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): () => number', gave the following error.
|
||||
Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'.
|
||||
!!! related TS2760 tests/cases/compiler/recursiveFunctionTypes.ts:43:4: Overload 2 of 4, '(a: number): number', gave the following error.
|
||||
Argument of type '""' is not assignable to parameter of type 'number'.
|
||||
!!! related TS2760 tests/cases/compiler/recursiveFunctionTypes.ts:43:4: Overload 3 of 4, '(a?: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }', gave the following error.
|
||||
Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'.
|
||||
!!! error TS2755: Overload 1 of 4, '(a: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): () => number', gave the following error.
|
||||
!!! error TS2755: Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'.
|
||||
!!! error TS2755: Overload 2 of 4, '(a: number): number', gave the following error.
|
||||
!!! error TS2755: Argument of type '""' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 3 of 4, '(a?: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }', gave the following error.
|
||||
!!! error TS2755: Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'.
|
||||
f7(); // ok
|
|
@ -1,5 +1,17 @@
|
|||
tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(7,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error.
|
||||
Argument of type '(x: string) => number' is not assignable to parameter of type '(x: number) => number'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error.
|
||||
Argument of type '1' is not assignable to parameter of type 'string'.
|
||||
tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error.
|
||||
Argument of type '(x: "hm") => number' is not assignable to parameter of type '(x: number) => number'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'number' is not assignable to type '"hm"'.
|
||||
Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error.
|
||||
Argument of type '1' is not assignable to parameter of type 'string'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts (2 errors) ====
|
||||
|
@ -12,18 +24,18 @@ tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,1): error TS2
|
|||
x3(1, (x: string) => 1);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:7:7: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error.
|
||||
Argument of type '(x: string) => number' is not assignable to parameter of type '(x: number) => number'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
!!! related TS2760 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:7:4: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error.
|
||||
Argument of type '1' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error.
|
||||
!!! error TS2755: Argument of type '(x: string) => number' is not assignable to parameter of type '(x: number) => number'.
|
||||
!!! error TS2755: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2755: Type 'number' is not assignable to type 'string'.
|
||||
!!! error TS2755: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error.
|
||||
!!! error TS2755: Argument of type '1' is not assignable to parameter of type 'string'.
|
||||
x3(1, (x: 'hm') => 1);
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:8:7: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error.
|
||||
Argument of type '(x: "hm") => number' is not assignable to parameter of type '(x: number) => number'.
|
||||
Types of parameters 'x' and 'x' are incompatible.
|
||||
Type 'number' is not assignable to type '"hm"'.
|
||||
!!! related TS2760 tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts:8:4: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error.
|
||||
Argument of type '1' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error.
|
||||
!!! error TS2755: Argument of type '(x: "hm") => number' is not assignable to parameter of type '(x: number) => number'.
|
||||
!!! error TS2755: Types of parameters 'x' and 'x' are incompatible.
|
||||
!!! error TS2755: Type 'number' is not assignable to type '"hm"'.
|
||||
!!! error TS2755: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error.
|
||||
!!! error TS2755: Argument of type '1' is not assignable to parameter of type 'string'.
|
|
@ -2,10 +2,26 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
|
|||
Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(10,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(11,9): error TS2755: No overload matches this call.
|
||||
Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,9): error TS2755: No overload matches this call.
|
||||
Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(13,9): error TS2755: No overload matches this call.
|
||||
Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(14,23): error TS2554: Expected 1-3 arguments, but got 4.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,9): error TS2755: No overload matches this call.
|
||||
Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(21,24): error TS2554: Expected 1-3 arguments, but got 4.
|
||||
|
||||
|
||||
|
@ -29,24 +45,24 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
|
|||
var c = foo([], 1, 2); // boolean
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:11:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:11:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
var d = foo([], 1, true); // boolean (with error)
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:12:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:12:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
var e = foo([], 1, "2"); // {}
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:13:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:13:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
var f = foo([], 1, 2, 3); // any (with error)
|
||||
~
|
||||
!!! error TS2554: Expected 1-3 arguments, but got 4.
|
||||
|
@ -57,10 +73,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
|
|||
var x = foo `${1}${true}`; // boolean (with error)
|
||||
~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:19:20: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:19:20: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
var y = foo `${1}${"2"}`; // {}
|
||||
var z = foo `${1}${2}${3}`; // any (with error)
|
||||
~
|
||||
|
|
|
@ -2,10 +2,26 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
|
|||
Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(10,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(11,9): error TS2755: No overload matches this call.
|
||||
Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,9): error TS2755: No overload matches this call.
|
||||
Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,9): error TS2755: No overload matches this call.
|
||||
Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(14,23): error TS2554: Expected 1-3 arguments, but got 4.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,9): error TS2755: No overload matches this call.
|
||||
Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(21,24): error TS2554: Expected 1-3 arguments, but got 4.
|
||||
|
||||
|
||||
|
@ -29,24 +45,24 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
|
|||
var c = foo([], 1, 2); // boolean
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:11:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:11:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
var d = foo([], 1, true); // boolean (with error)
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:12:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:12:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
var e = foo([], 1, "2"); // {}
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:13:13: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:13:13: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
!!! error TS2755: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
|
||||
var f = foo([], 1, 2, 3); // any (with error)
|
||||
~
|
||||
!!! error TS2554: Expected 1-3 arguments, but got 4.
|
||||
|
@ -57,10 +73,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
|
|||
var x = foo `${1}${true}`; // boolean (with error)
|
||||
~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:19:20: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:19:20: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
var y = foo `${1}${"2"}`; // {}
|
||||
var z = foo `${1}${2}${3}`; // any (with error)
|
||||
~
|
||||
|
|
|
@ -1,8 +1,20 @@
|
|||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(9,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error.
|
||||
Argument of type '{}' is not assignable to parameter of type 'string'.
|
||||
Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error.
|
||||
Argument of type '{}' is not assignable to parameter of type 'number'.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(18,4): error TS2339: Property 'foo' does not exist on type 'Date'.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(44,1): error TS2554: Expected 2-4 arguments, but got 1.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(62,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(69,18): error TS2339: Property 'toFixed' does not exist on type 'string'.
|
||||
|
||||
|
||||
|
@ -18,10 +30,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
|
|||
fn1 `${ {} }`; // Error
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:9:9: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error.
|
||||
Argument of type '{}' is not assignable to parameter of type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:9:9: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error.
|
||||
Argument of type '{}' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error.
|
||||
!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error.
|
||||
!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'number'.
|
||||
|
||||
function fn2(strs: TemplateStringsArray, s: string, n: number): number;
|
||||
function fn2<T>(strs: TemplateStringsArray, n: number, t: T): T;
|
||||
|
@ -82,17 +94,17 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
|
|||
fn4 `${ true }${ null }`;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:62:9: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:62:9: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
fn4 `${ null }${ true }`;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:63:18: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts:63:18: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
|
||||
// Non - generic overloads where contextual typing of function arguments has errors
|
||||
function fn5(strs: TemplateStringsArray, f: (n: string) => void): string;
|
||||
|
|
|
@ -1,8 +1,20 @@
|
|||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(9,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error.
|
||||
Argument of type '{}' is not assignable to parameter of type 'string'.
|
||||
Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error.
|
||||
Argument of type '{}' is not assignable to parameter of type 'number'.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(18,4): error TS2339: Property 'foo' does not exist on type 'Date'.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(44,1): error TS2554: Expected 2-4 arguments, but got 1.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(62,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(69,18): error TS2551: Property 'toFixed' does not exist on type 'string'. Did you mean 'fixed'?
|
||||
|
||||
|
||||
|
@ -18,10 +30,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
|
|||
fn1 `${ {} }`; // Error
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:9:9: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error.
|
||||
Argument of type '{}' is not assignable to parameter of type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:9:9: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error.
|
||||
Argument of type '{}' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error.
|
||||
!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error.
|
||||
!!! error TS2755: Argument of type '{}' is not assignable to parameter of type 'number'.
|
||||
|
||||
function fn2(strs: TemplateStringsArray, s: string, n: number): number;
|
||||
function fn2<T>(strs: TemplateStringsArray, n: number, t: T): T;
|
||||
|
@ -82,17 +94,17 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio
|
|||
fn4 `${ true }${ null }`;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:62:9: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:62:9: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
fn4 `${ null }${ true }`;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:63:18: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! related TS2760 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts:63:18: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
|
||||
// Non - generic overloads where contextual typing of function arguments has errors
|
||||
function fn5(strs: TemplateStringsArray, f: (n: string) => void): string;
|
||||
|
|
|
@ -1,6 +1,18 @@
|
|||
tests/cases/conformance/jsx/file.tsx(11,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(n: string): { x: number; }', gave the following error.
|
||||
Type '{}' is not assignable to type 'string'.
|
||||
Overload 2 of 2, '(n: number): { y: string; }', gave the following error.
|
||||
Type '{}' is not assignable to type 'number'.
|
||||
tests/cases/conformance/jsx/file.tsx(18,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(n: string): { x: number; }', gave the following error.
|
||||
Type '{}' is not assignable to type 'string'.
|
||||
Overload 2 of 2, '(n: number): { y: string; }', gave the following error.
|
||||
Type '{}' is not assignable to type 'number'.
|
||||
tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(n: string): { x: number; }', gave the following error.
|
||||
Type '{ x: number; }' is not assignable to type 'string'.
|
||||
Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error.
|
||||
Type '{ x: number; }' is not assignable to type 'number'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/jsx/file.tsx (3 errors) ====
|
||||
|
@ -17,10 +29,10 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No overload matches th
|
|||
<Obj1 />; // Error, return type is not an object type
|
||||
~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:11:2: Overload 1 of 2, '(n: string): { x: number; }', gave the following error.
|
||||
Type '{}' is not assignable to type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:11:2: Overload 2 of 2, '(n: number): { y: string; }', gave the following error.
|
||||
Type '{}' is not assignable to type 'number'.
|
||||
!!! error TS2755: Overload 1 of 2, '(n: string): { x: number; }', gave the following error.
|
||||
!!! error TS2755: Type '{}' is not assignable to type 'string'.
|
||||
!!! error TS2755: Overload 2 of 2, '(n: number): { y: string; }', gave the following error.
|
||||
!!! error TS2755: Type '{}' is not assignable to type 'number'.
|
||||
|
||||
interface Obj2 {
|
||||
(n: string): { x: number };
|
||||
|
@ -30,10 +42,10 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No overload matches th
|
|||
<Obj2 />; // Error, return type is not an object type
|
||||
~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:18:2: Overload 1 of 2, '(n: string): { x: number; }', gave the following error.
|
||||
Type '{}' is not assignable to type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:18:2: Overload 2 of 2, '(n: number): { y: string; }', gave the following error.
|
||||
Type '{}' is not assignable to type 'number'.
|
||||
!!! error TS2755: Overload 1 of 2, '(n: string): { x: number; }', gave the following error.
|
||||
!!! error TS2755: Type '{}' is not assignable to type 'string'.
|
||||
!!! error TS2755: Overload 2 of 2, '(n: number): { y: string; }', gave the following error.
|
||||
!!! error TS2755: Type '{}' is not assignable to type 'number'.
|
||||
|
||||
interface Obj3 {
|
||||
(n: string): { x: number };
|
||||
|
@ -43,8 +55,8 @@ tests/cases/conformance/jsx/file.tsx(25,1): error TS2755: No overload matches th
|
|||
<Obj3 x={42} />; // OK
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:25:2: Overload 1 of 2, '(n: string): { x: number; }', gave the following error.
|
||||
Type '{ x: number; }' is not assignable to type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:25:2: Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error.
|
||||
Type '{ x: number; }' is not assignable to type 'number'.
|
||||
!!! error TS2755: Overload 1 of 2, '(n: string): { x: number; }', gave the following error.
|
||||
!!! error TS2755: Type '{ x: number; }' is not assignable to type 'string'.
|
||||
!!! error TS2755: Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error.
|
||||
!!! error TS2755: Type '{ x: number; }' is not assignable to type 'number'.
|
||||
|
|
@ -1,14 +1,79 @@
|
|||
tests/cases/conformance/jsx/file.tsx(12,12): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(): Element', gave the following error.
|
||||
Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'.
|
||||
Property 'extraProp' does not exist on type 'IntrinsicAttributes'.
|
||||
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; }'.
|
||||
tests/cases/conformance/jsx/file.tsx(13,12): error TS2755: 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'.
|
||||
Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error.
|
||||
Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'.
|
||||
tests/cases/conformance/jsx/file.tsx(14,12): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(): Element', gave the following error.
|
||||
Type '{ yy1: true; yy: number; }' is not assignable to type 'IntrinsicAttributes'.
|
||||
Property 'yy1' does not exist on type 'IntrinsicAttributes'.
|
||||
Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error.
|
||||
Type 'true' is not assignable to type 'string'.
|
||||
tests/cases/conformance/jsx/file.tsx(16,12): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(): Element', gave the following error.
|
||||
Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes'.
|
||||
Property 'y1' does not exist on type 'IntrinsicAttributes'.
|
||||
Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error.
|
||||
Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
|
||||
Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
|
||||
tests/cases/conformance/jsx/file.tsx(17,12): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(): Element', gave the following error.
|
||||
Type '{ yy: boolean; yy1: string; }' has no properties in common with type 'IntrinsicAttributes'.
|
||||
Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error.
|
||||
Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'.
|
||||
Types of property 'yy' are incompatible.
|
||||
Type 'boolean' is not assignable to type 'number'.
|
||||
tests/cases/conformance/jsx/file.tsx(25,12): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error.
|
||||
Type 'true' 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; }'.
|
||||
tests/cases/conformance/jsx/file.tsx(26,12): error TS2755: 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'.
|
||||
tests/cases/conformance/jsx/file.tsx(33,12): error TS2755: No overload matches this call.
|
||||
Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error.
|
||||
Type 'true' is not assignable to type 'string'.
|
||||
Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error.
|
||||
Type 'true' 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'.
|
||||
tests/cases/conformance/jsx/file.tsx(34,12): error TS2755: 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; }'.
|
||||
Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error.
|
||||
Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'.
|
||||
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'.
|
||||
tests/cases/conformance/jsx/file.tsx(35,12): error TS2755: 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; }'.
|
||||
Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error.
|
||||
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'.
|
||||
tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: 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; }'.
|
||||
Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error.
|
||||
'TestingOptional' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is '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'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/jsx/file.tsx (11 errors) ====
|
||||
|
@ -26,47 +91,47 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No overload matches t
|
|||
const c0 = <OneThing extraProp />; // extra property;
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:12:13: Overload 1 of 2, '(): Element', gave the following error.
|
||||
Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'.
|
||||
Property 'extraProp' does not exist on type 'IntrinsicAttributes'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:12:13: 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; }'.
|
||||
!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'.
|
||||
!!! error TS2755: Property 'extraProp' does not exist on type 'IntrinsicAttributes'.
|
||||
!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
|
||||
!!! error TS2755: Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
|
||||
const c1 = <OneThing yy={10}/>; // missing property;
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:13:13: 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'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:13:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error.
|
||||
Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'.
|
||||
!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'.
|
||||
!!! error TS2755: Property 'yy' does not exist on type 'IntrinsicAttributes'.
|
||||
!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error.
|
||||
!!! error TS2755: Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'.
|
||||
const c2 = <OneThing {...obj} yy1 />; // type incompatible;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:14:13: Overload 1 of 2, '(): Element', gave the following error.
|
||||
Type '{ yy1: true; yy: number; }' is not assignable to type 'IntrinsicAttributes'.
|
||||
Property 'yy1' does not exist on type 'IntrinsicAttributes'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:14:31: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error.
|
||||
Type 'true' is not assignable to type 'string'.
|
||||
!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ yy1: true; yy: number; }' is not assignable to type 'IntrinsicAttributes'.
|
||||
!!! error TS2755: Property 'yy1' does not exist on type 'IntrinsicAttributes'.
|
||||
!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error.
|
||||
!!! error TS2755: Type 'true' is not assignable to type 'string'.
|
||||
const c3 = <OneThing {...obj} {...{extra: "extra attr"}} />; // This is OK becuase all attribute are spread
|
||||
const c4 = <OneThing {...obj} y1={10000} />; // extra property;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:16:13: Overload 1 of 2, '(): Element', gave the following error.
|
||||
Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes'.
|
||||
Property 'y1' does not exist on type 'IntrinsicAttributes'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:16:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error.
|
||||
Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
|
||||
Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
|
||||
!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes'.
|
||||
!!! error TS2755: Property 'y1' does not exist on type 'IntrinsicAttributes'.
|
||||
!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
|
||||
!!! error TS2755: Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
|
||||
const c5 = <OneThing {...obj} {...{yy: true}} />; // type incompatible;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:17:13: Overload 1 of 2, '(): Element', gave the following error.
|
||||
Type '{ yy: boolean; yy1: string; }' has no properties in common with type 'IntrinsicAttributes'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:17:13: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error.
|
||||
Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'.
|
||||
Types of property 'yy' are incompatible.
|
||||
Type 'boolean' is not assignable to type 'number'.
|
||||
!!! error TS2755: Overload 1 of 2, '(): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ yy: boolean; yy1: string; }' has no properties in common with type 'IntrinsicAttributes'.
|
||||
!!! error TS2755: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'.
|
||||
!!! error TS2755: Types of property 'yy' are incompatible.
|
||||
!!! error TS2755: Type 'boolean' is not assignable to type 'number'.
|
||||
const c6 = <OneThing {...obj2} {...{extra: "extra attr"}} />; // Should error as there is extra attribute that doesn't match any. Current it is not
|
||||
const c7 = <OneThing {...obj2} yy />; // Should error as there is extra attribute that doesn't match any. Current it is not
|
||||
|
||||
|
@ -77,18 +142,18 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No overload matches t
|
|||
const d1 = <TestingOneThing extra-data />
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:25:29: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error.
|
||||
Type 'true' is not assignable to type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:25:13: 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; }'.
|
||||
!!! error TS2755: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error.
|
||||
!!! error TS2755: Type 'true' is not assignable to type 'string'.
|
||||
!!! error TS2755: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error.
|
||||
!!! error TS2755: Property 'yy' is missing in type '{ extra-data: true; }' but required in type '{ yy: string; direction?: number; }'.
|
||||
const d2 = <TestingOneThing yy="hello" direction="left" />
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:26:13: 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; }'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:26:40: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
!!! error TS2755: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'.
|
||||
!!! error TS2755: Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'.
|
||||
!!! error TS2755: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error.
|
||||
!!! error TS2755: Type 'string' is not assignable to type 'number'.
|
||||
|
||||
declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element;
|
||||
declare function TestingOptional(a: {y1?: string, y2?: number, children: JSX.Element}): JSX.Element;
|
||||
|
@ -98,41 +163,41 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2755: No overload matches t
|
|||
const e1 = <TestingOptional y1 y3="hello"/>
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:33:29: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error.
|
||||
Type 'true' is not assignable to type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:33:29: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error.
|
||||
Type 'true' is not assignable to type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:33:32: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error.
|
||||
Type 'string' is not assignable to type 'boolean'.
|
||||
!!! error TS2755: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error.
|
||||
!!! error TS2755: Type 'true' is not assignable to type 'string'.
|
||||
!!! error TS2755: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error.
|
||||
!!! error TS2755: Type 'true' is not assignable to type 'string'.
|
||||
!!! error TS2755: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error.
|
||||
!!! error TS2755: Type 'string' is not assignable to type 'boolean'.
|
||||
const e2 = <TestingOptional y1="hello" y2={1000} y3 />
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:34:13: 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; }'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:34:13: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error.
|
||||
Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'.
|
||||
Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:34:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error.
|
||||
Type 'string' is not assignable to type 'boolean'.
|
||||
!!! error TS2755: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
|
||||
!!! error TS2755: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
|
||||
!!! error TS2755: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'.
|
||||
!!! error TS2755: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'.
|
||||
!!! error TS2755: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error.
|
||||
!!! error TS2755: Type 'string' is not assignable to type 'boolean'.
|
||||
const e3 = <TestingOptional y1="hello" y2={1000} children="hi" />
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:35:13: 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; }'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:35:50: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error.
|
||||
Type 'string' is not assignable to type 'Element'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:35:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error.
|
||||
Type 'string' is not assignable to type 'boolean'.
|
||||
!!! error TS2755: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
|
||||
!!! error TS2755: Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
|
||||
!!! error TS2755: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error.
|
||||
!!! error TS2755: Type 'string' is not assignable to type 'Element'.
|
||||
!!! error TS2755: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error.
|
||||
!!! error TS2755: Type 'string' is not assignable to type 'boolean'.
|
||||
const e4 = <TestingOptional y1="hello" y2={1000}>Hi</TestingOptional>
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:36:13: 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; }'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:36:50: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error.
|
||||
'TestingOptional' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is 'Element'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:36:29: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error.
|
||||
Type 'string' is not assignable to type 'boolean'.
|
||||
!!! error TS2755: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ children: string; y1: string; y2: number; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
|
||||
!!! error TS2755: Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
|
||||
!!! error TS2755: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error.
|
||||
!!! error TS2755: 'TestingOptional' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is 'Element'.
|
||||
!!! error TS2755: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error.
|
||||
!!! error TS2755: Type 'string' is not assignable to type 'boolean'.
|
||||
|
|
@ -1,7 +1,34 @@
|
|||
tests/cases/conformance/jsx/file.tsx(48,12): error TS2755: 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'.
|
||||
Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error.
|
||||
Type '{ children: string; to: string; onClick: (e: MouseEvent<any>) => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error.
|
||||
Type '{ children: string; to: string; onClick: (e: MouseEvent<any>) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
|
||||
Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'.
|
||||
tests/cases/conformance/jsx/file.tsx(54,12): error TS2755: No overload matches this call.
|
||||
Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
tests/cases/conformance/jsx/file.tsx(55,12): error TS2755: No overload matches this call.
|
||||
Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
Type 'true' is not assignable to type 'string'.
|
||||
Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error.
|
||||
Type 'true' is not assignable to type 'string'.
|
||||
Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error.
|
||||
Type 'true' is not assignable to type 'string'.
|
||||
tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No overload matches this call.
|
||||
Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
Property 'onClick' is missing in type '{ data-format: true; }' but required in type 'ButtonProps'.
|
||||
Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error.
|
||||
Property 'to' is missing in type '{ data-format: true; }' but required in type 'LinkProps'.
|
||||
Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error.
|
||||
Type 'true' is not assignable to type 'string'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/jsx/file.tsx (4 errors) ====
|
||||
|
@ -55,15 +82,15 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No overload matches t
|
|||
const b0 = <MainButton to='/some/path' onClick={(e)=>{}}>GO</MainButton>; // extra property;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:48:13: 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'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:48:13: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error.
|
||||
Type '{ children: string; to: string; onClick: (e: MouseEvent<any>) => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:48:13: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error.
|
||||
Type '{ children: string; to: string; onClick: (e: MouseEvent<any>) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
|
||||
Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'.
|
||||
!!! error TS2755: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ children: string; to: string; onClick: (e: MouseEvent<any>) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
|
||||
!!! error TS2755: Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'.
|
||||
!!! error TS2755: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ children: string; to: string; onClick: (e: MouseEvent<any>) => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
!!! error TS2755: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
!!! error TS2755: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ children: string; to: string; onClick: (e: MouseEvent<any>) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
|
||||
!!! error TS2755: Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'.
|
||||
const b1 = <MainButton onClick={(e: any)=> {}} {...obj0}>Hello world</MainButton>; // extra property;
|
||||
const b2 = <MainButton {...{to: "10000"}} {...obj2} />; // extra property
|
||||
const b3 = <MainButton {...{to: "10000"}} {...{onClick: (k) => {}}} />; // extra property
|
||||
|
@ -72,27 +99,27 @@ tests/cases/conformance/jsx/file.tsx(56,12): error TS2755: No overload matches t
|
|||
const b6 = <MainButton {...{ onClick(e: any){} }} children={10} />; // incorrect type for optional attribute
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:54:51: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:54:51: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:54:51: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
!!! error TS2755: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
!!! error TS2755: Type 'number' is not assignable to type 'string'.
|
||||
!!! error TS2755: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error.
|
||||
!!! error TS2755: Type 'number' is not assignable to type 'string'.
|
||||
!!! error TS2755: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error.
|
||||
!!! error TS2755: Type 'number' is not assignable to type 'string'.
|
||||
const b7 = <MainButton {...{ onClick(e: any){} }} children="hello" className />; // incorrect type for optional attribute
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:55:68: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
Type 'true' is not assignable to type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:55:68: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error.
|
||||
Type 'true' is not assignable to type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:55:68: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error.
|
||||
Type 'true' is not assignable to type 'string'.
|
||||
!!! error TS2755: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
!!! error TS2755: Type 'true' is not assignable to type 'string'.
|
||||
!!! error TS2755: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error.
|
||||
!!! error TS2755: Type 'true' is not assignable to type 'string'.
|
||||
!!! error TS2755: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error.
|
||||
!!! error TS2755: Type 'true' is not assignable to type 'string'.
|
||||
const b8 = <MainButton data-format />; // incorrect type for specified hyphanated name
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:56:13: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
Property 'onClick' is missing in type '{ data-format: true; }' but required in type 'ButtonProps'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:56:13: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error.
|
||||
Property 'to' is missing in type '{ data-format: true; }' but required in type 'LinkProps'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:56:24: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error.
|
||||
Type 'true' is not assignable to type 'string'.
|
||||
!!! error TS2755: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error.
|
||||
!!! error TS2755: Property 'onClick' is missing in type '{ data-format: true; }' but required in type 'ButtonProps'.
|
||||
!!! error TS2755: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error.
|
||||
!!! error TS2755: Property 'to' is missing in type '{ data-format: true; }' but required in type 'LinkProps'.
|
||||
!!! error TS2755: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error.
|
||||
!!! error TS2755: Type 'true' is not assignable to type 'string'.
|
|
@ -1,5 +1,20 @@
|
|||
tests/cases/conformance/jsx/file.tsx(9,14): error TS2755: 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'.
|
||||
Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error.
|
||||
Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'.
|
||||
tests/cases/conformance/jsx/file.tsx(10,14): error TS2755: No overload matches this call.
|
||||
Overload 1 of 3, '(): Element', gave the following error.
|
||||
Type 'T & { ignore-prop: true; }' has no properties in common with type 'IntrinsicAttributes'.
|
||||
Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error.
|
||||
Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: string; "ignore-prop": boolean; }'.
|
||||
Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: string; "ignore-prop": boolean; }'.
|
||||
Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error.
|
||||
Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'.
|
||||
Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/jsx/file.tsx (2 errors) ====
|
||||
|
@ -14,22 +29,22 @@ tests/cases/conformance/jsx/file.tsx(10,14): error TS2755: No overload matches t
|
|||
let a0 = <OverloadComponent a={arg1.b}/>
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:9:15: 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'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:9:33: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:9:15: Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error.
|
||||
Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'.
|
||||
!!! error TS2755: Overload 1 of 3, '(): Element', gave the following error.
|
||||
!!! error TS2755: Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'.
|
||||
!!! error TS2755: Property 'a' does not exist on type 'IntrinsicAttributes'.
|
||||
!!! error TS2755: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error.
|
||||
!!! error TS2755: Type 'number' is not assignable to type 'string'.
|
||||
!!! error TS2755: Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error.
|
||||
!!! error TS2755: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'.
|
||||
let a2 = <OverloadComponent {...arg1} ignore-prop /> // missing a
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:10:15: Overload 1 of 3, '(): Element', gave the following error.
|
||||
Type 'T & { ignore-prop: true; }' has no properties in common with type 'IntrinsicAttributes'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:10:15: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error.
|
||||
Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: string; "ignore-prop": boolean; }'.
|
||||
Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: string; "ignore-prop": boolean; }'.
|
||||
!!! related TS2760 tests/cases/conformance/jsx/file.tsx:10:15: Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error.
|
||||
Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'.
|
||||
Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'.
|
||||
!!! error TS2755: Overload 1 of 3, '(): Element', gave the following error.
|
||||
!!! error TS2755: Type 'T & { ignore-prop: true; }' has no properties in common with type 'IntrinsicAttributes'.
|
||||
!!! error TS2755: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error.
|
||||
!!! error TS2755: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: string; "ignore-prop": boolean; }'.
|
||||
!!! error TS2755: Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: string; "ignore-prop": boolean; }'.
|
||||
!!! error TS2755: Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error.
|
||||
!!! error TS2755: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'.
|
||||
!!! error TS2755: Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: unknown; a: unknown; }'.
|
||||
}
|
|
@ -1,6 +1,14 @@
|
|||
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(9,43): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'.
|
||||
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(10,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(a: number): number | Date', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
Overload 2 of 2, '(a: string): string | boolean', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(15,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(a: number): number | Date', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
Overload 2 of 2, '(a: string): string | boolean', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(16,1): error TS2554: Expected 1 arguments, but got 0.
|
||||
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(19,32): error TS2345: Argument of type '10' is not assignable to parameter of type 'never'.
|
||||
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(20,32): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'never'.
|
||||
|
@ -42,10 +50,10 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2
|
|||
unionOfDifferentReturnType1(true); // error in type of parameter
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:10:29: Overload 1 of 2, '(a: number): number | Date', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! related TS2760 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:10:29: Overload 2 of 2, '(a: string): string | boolean', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 1 of 2, '(a: number): number | Date', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 2 of 2, '(a: string): string | boolean', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
|
||||
var unionOfDifferentReturnType1: { (a: number): number; (a: string): string; } | { (a: number): Date; (a: string): boolean; };
|
||||
numOrDate = unionOfDifferentReturnType1(10);
|
||||
|
@ -53,10 +61,10 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2
|
|||
unionOfDifferentReturnType1(true); // error in type of parameter
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:15:29: Overload 1 of 2, '(a: number): number | Date', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! related TS2760 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:15:29: Overload 2 of 2, '(a: string): string | boolean', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 1 of 2, '(a: number): number | Date', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 2 of 2, '(a: string): string | boolean', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
unionOfDifferentReturnType1(); // error missing parameter
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2554: Expected 1 arguments, but got 0.
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(9,47): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'.
|
||||
tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(10,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(a: number): number | Date', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
Overload 2 of 2, '(a: string): string | boolean', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(15,1): error TS2755: No overload matches this call.
|
||||
Overload 1 of 2, '(a: number): number | Date', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
Overload 2 of 2, '(a: string): string | boolean', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(16,1): error TS2554: Expected 1 arguments, but got 0.
|
||||
tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(19,36): error TS2345: Argument of type '10' is not assignable to parameter of type 'never'.
|
||||
tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(20,36): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'never'.
|
||||
|
@ -41,10 +49,10 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(70,12): erro
|
|||
new unionOfDifferentReturnType1(true); // error in type of parameter
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:10:33: Overload 1 of 2, '(a: number): number | Date', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! related TS2760 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:10:33: Overload 2 of 2, '(a: string): string | boolean', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 1 of 2, '(a: number): number | Date', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 2 of 2, '(a: string): string | boolean', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
|
||||
var unionOfDifferentReturnType1: { new (a: number): number; new (a: string): string; } | { new (a: number): Date; new (a: string): boolean; };
|
||||
numOrDate = new unionOfDifferentReturnType1(10);
|
||||
|
@ -52,10 +60,10 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(70,12): erro
|
|||
new unionOfDifferentReturnType1(true); // error in type of parameter
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2755: No overload matches this call.
|
||||
!!! related TS2760 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:15:33: Overload 1 of 2, '(a: number): number | Date', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! related TS2760 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:15:33: Overload 2 of 2, '(a: string): string | boolean', gave the following error.
|
||||
Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
!!! error TS2755: Overload 1 of 2, '(a: number): number | Date', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'number'.
|
||||
!!! error TS2755: Overload 2 of 2, '(a: string): string | boolean', gave the following error.
|
||||
!!! error TS2755: Argument of type 'true' is not assignable to parameter of type 'string'.
|
||||
new unionOfDifferentReturnType1(); // error missing parameter
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2554: Expected 1 arguments, but got 0.
|
||||
|
|
Loading…
Reference in a new issue