mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
254 lines
22 KiB
Diff
254 lines
22 KiB
Diff
--- old.tsxStatelessFunctionComponentOverload4.errors.txt
|
|
+++ new.tsxStatelessFunctionComponentOverload4.errors.txt
|
|
@@= skipped -0, +0 lines =@@
|
|
file.tsx(14,22): error TS2769: 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.
|
|
+ The last overload gave the following error.
|
|
Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
|
|
Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
|
|
file.tsx(15,13): error TS2769: No overload matches this call.
|
|
- Overload 1 of 2, '(): Element', gave the following error.
|
|
- Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'.
|
|
- Property 'yy' does not exist on type 'IntrinsicAttributes'.
|
|
- Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error.
|
|
+ The last overload gave the following error.
|
|
Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'.
|
|
file.tsx(16,31): error TS2769: No overload matches this call.
|
|
- Overload 1 of 2, '(): Element', gave the following error.
|
|
- Type '{ yy: number; yy1: true; }' 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.
|
|
+ The last overload gave the following error.
|
|
Type 'boolean' is not assignable to type 'string'.
|
|
file.tsx(18,31): error TS2769: No overload matches this call.
|
|
- Overload 1 of 2, '(): Element', gave the following error.
|
|
- Type '{ yy: number; yy1: string; y1: number; }' 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.
|
|
+ The last overload gave the following error.
|
|
Type '{ yy: number; yy1: string; y1: number; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
|
|
Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
|
|
file.tsx(19,13): error TS2769: No overload matches this call.
|
|
- Overload 1 of 2, '(): Element', gave the following error.
|
|
- Type '{ yy1: string; yy: boolean; }' has no properties in common with type 'IntrinsicAttributes'.
|
|
- Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error.
|
|
+ The last overload gave the following error.
|
|
Type '{ yy1: string; yy: boolean; }' is not assignable to type '{ yy: number; yy1: string; }'.
|
|
Types of property 'yy' are incompatible.
|
|
Type 'boolean' is not assignable to type 'number'.
|
|
file.tsx(27,13): error TS2769: No overload matches this call.
|
|
- Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error.
|
|
- Type '{ "extra-data": true; }' is not assignable to type '{ "extra-data": string; }'.
|
|
- Types of property '"extra-data"' are incompatible.
|
|
- Type 'boolean' is not assignable to type 'string'.
|
|
- Overload 2 of 2, '(n: { yy: string; direction?: number | undefined; }): Element', gave the following error.
|
|
+ The last overload gave the following error.
|
|
Property 'yy' is missing in type '{ "extra-data": true; }' but required in type '{ yy: string; direction?: number | undefined; }'.
|
|
-file.tsx(28,13): error TS2769: No overload matches this call.
|
|
- Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error.
|
|
- Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'.
|
|
- Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'.
|
|
- Overload 2 of 2, '(n: { yy: string; direction?: number | undefined; }): Element', gave the following error.
|
|
+file.tsx(28,40): error TS2769: No overload matches this call.
|
|
+ The last overload gave the following error.
|
|
Type 'string' is not assignable to type 'number'.
|
|
-file.tsx(35,13): error TS2769: No overload matches this call.
|
|
- Overload 1 of 3, '(a: { y1?: string | undefined; y2?: number | undefined; }): Element', gave the following error.
|
|
- Type 'boolean' is not assignable to type 'string'.
|
|
- Overload 2 of 3, '(a: { y1?: string | undefined; y2?: number | undefined; children: Element; }): Element', gave the following error.
|
|
- Type 'boolean' is not assignable to type 'string'.
|
|
- Overload 3 of 3, '(a: { y1: boolean; y2?: number | undefined; y3: boolean; }): Element', gave the following error.
|
|
- Type 'string' is not assignable to type 'boolean'.
|
|
-file.tsx(36,13): error TS2769: No overload matches this call.
|
|
- Overload 1 of 3, '(a: { y1?: string | undefined; y2?: number | undefined; }): Element', gave the following error.
|
|
- Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string | undefined; y2?: number | undefined; }'.
|
|
- Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string | undefined; y2?: number | undefined; }'.
|
|
- Overload 2 of 3, '(a: { y1?: string | undefined; y2?: number | undefined; children: Element; }): Element', gave the following error.
|
|
- Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string | undefined; y2?: number | undefined; children: Element; }'.
|
|
- Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string | undefined; y2?: number | undefined; children: Element; }'.
|
|
- Overload 3 of 3, '(a: { y1: boolean; y2?: number | undefined; y3: boolean; }): Element', gave the following error.
|
|
- Type 'string' is not assignable to type 'boolean'.
|
|
-file.tsx(37,13): error TS2769: No overload matches this call.
|
|
- Overload 1 of 3, '(a: { y1?: string | undefined; y2?: number | undefined; }): Element', gave the following error.
|
|
- Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string | undefined; y2?: number | undefined; }'.
|
|
- Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string | undefined; y2?: number | undefined; }'.
|
|
- Overload 2 of 3, '(a: { y1?: string | undefined; y2?: number | undefined; children: Element; }): Element', gave the following error.
|
|
- Type 'string' is not assignable to type 'Element'.
|
|
- Overload 3 of 3, '(a: { y1: boolean; y2?: number | undefined; y3: boolean; }): Element', gave the following error.
|
|
- Type 'string' is not assignable to type 'boolean'.
|
|
-file.tsx(38,13): error TS2769: No overload matches this call.
|
|
- Overload 1 of 3, '(a: { y1?: string | undefined; y2?: number | undefined; }): Element', gave the following error.
|
|
- Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string | undefined; y2?: number | undefined; }'.
|
|
- Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string | undefined; y2?: number | undefined; }'.
|
|
- Overload 2 of 3, '(a: { y1?: string | undefined; y2?: number | undefined; 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 | undefined; y3: boolean; }): Element', gave the following error.
|
|
+file.tsx(35,32): error TS2769: No overload matches this call.
|
|
+ The last overload gave the following error.
|
|
+ Type 'string' is not assignable to type 'boolean'.
|
|
+file.tsx(36,29): error TS2769: No overload matches this call.
|
|
+ The last overload gave the following error.
|
|
+ Type 'string' is not assignable to type 'boolean'.
|
|
+file.tsx(37,29): error TS2769: No overload matches this call.
|
|
+ The last overload gave the following error.
|
|
+ Type 'string' is not assignable to type 'boolean'.
|
|
+file.tsx(38,29): error TS2769: No overload matches this call.
|
|
+ The last overload gave the following error.
|
|
Type 'string' is not assignable to type 'boolean'.
|
|
|
|
|
|
@@= skipped -94, +53 lines =@@
|
|
const c0 = <OneThing extraProp />; // extra property;
|
|
~~~~~~~~~
|
|
!!! error TS2769: No overload matches this call.
|
|
-!!! error TS2769: Overload 1 of 2, '(): Element', gave the following error.
|
|
-!!! error TS2769: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'.
|
|
-!!! error TS2769: Property 'extraProp' does not exist on type 'IntrinsicAttributes'.
|
|
-!!! error TS2769: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error.
|
|
+!!! error TS2769: The last overload gave the following error.
|
|
!!! error TS2769: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
|
|
!!! error TS2769: Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
|
|
+!!! related TS2771 file.tsx:5:18: The last overload is declared here.
|
|
const c1 = <OneThing yy={10}/>; // missing property;
|
|
~~~~~~~~
|
|
!!! error TS2769: No overload matches this call.
|
|
-!!! error TS2769: Overload 1 of 2, '(): Element', gave the following error.
|
|
-!!! error TS2769: Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'.
|
|
-!!! error TS2769: Property 'yy' does not exist on type 'IntrinsicAttributes'.
|
|
-!!! error TS2769: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error.
|
|
+!!! error TS2769: The last overload gave the following error.
|
|
!!! error TS2769: Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'.
|
|
!!! related TS2728 file.tsx:5:43: 'yy1' is declared here.
|
|
+!!! related TS2771 file.tsx:5:18: The last overload is declared here.
|
|
const c2 = <OneThing {...obj} yy1 />; // type incompatible;
|
|
~~~
|
|
!!! error TS2769: No overload matches this call.
|
|
-!!! error TS2769: Overload 1 of 2, '(): Element', gave the following error.
|
|
-!!! error TS2769: Type '{ yy: number; yy1: true; }' is not assignable to type 'IntrinsicAttributes'.
|
|
-!!! error TS2769: Property 'yy1' does not exist on type 'IntrinsicAttributes'.
|
|
-!!! error TS2769: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error.
|
|
+!!! error TS2769: The last overload gave the following error.
|
|
!!! error TS2769: Type 'boolean' is not assignable to type 'string'.
|
|
!!! related TS6500 file.tsx:5:43: The expected type comes from property 'yy1' which is declared here on type 'IntrinsicAttributes & { yy: number; yy1: string; }'
|
|
+!!! related TS2771 file.tsx:5:18: The last overload is declared here.
|
|
const c3 = <OneThing {...obj} {...{extra: "extra attr"}} />; // This is OK because all attribute are spread
|
|
const c4 = <OneThing {...obj} y1={10000} />; // extra property;
|
|
~~
|
|
!!! error TS2769: No overload matches this call.
|
|
-!!! error TS2769: Overload 1 of 2, '(): Element', gave the following error.
|
|
-!!! error TS2769: Type '{ yy: number; yy1: string; y1: number; }' is not assignable to type 'IntrinsicAttributes'.
|
|
-!!! error TS2769: Property 'y1' does not exist on type 'IntrinsicAttributes'.
|
|
-!!! error TS2769: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error.
|
|
+!!! error TS2769: The last overload gave the following error.
|
|
!!! error TS2769: Type '{ yy: number; yy1: string; y1: number; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
|
|
!!! error TS2769: Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
|
|
+!!! related TS2771 file.tsx:5:18: The last overload is declared here.
|
|
const c5 = <OneThing {...obj} {...{yy: true}} />; // type incompatible;
|
|
~~~~~~~~
|
|
!!! error TS2769: No overload matches this call.
|
|
-!!! error TS2769: Overload 1 of 2, '(): Element', gave the following error.
|
|
-!!! error TS2769: Type '{ yy1: string; yy: boolean; }' has no properties in common with type 'IntrinsicAttributes'.
|
|
-!!! error TS2769: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error.
|
|
+!!! error TS2769: The last overload gave the following error.
|
|
!!! error TS2769: Type '{ yy1: string; yy: boolean; }' is not assignable to type '{ yy: number; yy1: string; }'.
|
|
!!! error TS2769: Types of property 'yy' are incompatible.
|
|
!!! error TS2769: Type 'boolean' is not assignable to type 'number'.
|
|
+!!! related TS2771 file.tsx:5:18: The last overload is declared here.
|
|
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
|
|
|
|
@@= skipped -53, +44 lines =@@
|
|
const d1 = <TestingOneThing extra-data />
|
|
~~~~~~~~~~~~~~~
|
|
!!! error TS2769: No overload matches this call.
|
|
-!!! error TS2769: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error.
|
|
-!!! error TS2769: Type '{ "extra-data": true; }' is not assignable to type '{ "extra-data": string; }'.
|
|
-!!! error TS2769: Types of property '"extra-data"' are incompatible.
|
|
-!!! error TS2769: Type 'boolean' is not assignable to type 'string'.
|
|
-!!! error TS2769: Overload 2 of 2, '(n: { yy: string; direction?: number | undefined; }): Element', gave the following error.
|
|
+!!! error TS2769: The last overload gave the following error.
|
|
!!! error TS2769: Property 'yy' is missing in type '{ "extra-data": true; }' but required in type '{ yy: string; direction?: number | undefined; }'.
|
|
!!! related TS2728 file.tsx:24:38: 'yy' is declared here.
|
|
+!!! related TS2771 file.tsx:24:18: The last overload is declared here.
|
|
const d2 = <TestingOneThing yy="hello" direction="left" />
|
|
- ~~~~~~~~~~~~~~~
|
|
+ ~~~~~~~~~
|
|
!!! error TS2769: No overload matches this call.
|
|
-!!! error TS2769: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error.
|
|
-!!! error TS2769: Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'.
|
|
-!!! error TS2769: Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'.
|
|
-!!! error TS2769: Overload 2 of 2, '(n: { yy: string; direction?: number | undefined; }): Element', gave the following error.
|
|
+!!! error TS2769: The last overload gave the following error.
|
|
!!! error TS2769: Type 'string' is not assignable to type 'number'.
|
|
!!! related TS6500 file.tsx:24:50: The expected type comes from property 'direction' which is declared here on type 'IntrinsicAttributes & { yy: string; direction?: number | undefined; }'
|
|
+!!! related TS2771 file.tsx:24:18: The last overload is declared here.
|
|
|
|
declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element;
|
|
declare function TestingOptional(a: {y1?: string, y2?: number, children: JSX.Element}): JSX.Element;
|
|
@@= skipped -23, +18 lines =@@
|
|
|
|
// Error
|
|
const e1 = <TestingOptional y1 y3="hello"/>
|
|
- ~~~~~~~~~~~~~~~
|
|
+ ~~
|
|
!!! error TS2769: No overload matches this call.
|
|
-!!! error TS2769: Overload 1 of 3, '(a: { y1?: string | undefined; y2?: number | undefined; }): Element', gave the following error.
|
|
-!!! error TS2769: Type 'boolean' is not assignable to type 'string'.
|
|
-!!! error TS2769: Overload 2 of 3, '(a: { y1?: string | undefined; y2?: number | undefined; children: Element; }): Element', gave the following error.
|
|
-!!! error TS2769: Type 'boolean' is not assignable to type 'string'.
|
|
-!!! error TS2769: Overload 3 of 3, '(a: { y1: boolean; y2?: number | undefined; y3: boolean; }): Element', gave the following error.
|
|
+!!! error TS2769: The last overload gave the following error.
|
|
!!! error TS2769: Type 'string' is not assignable to type 'boolean'.
|
|
-!!! related TS6500 file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1?: string | undefined; y2?: number | undefined; }'
|
|
-!!! related TS6500 file.tsx:31:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1?: string | undefined; y2?: number | undefined; children: Element; }'
|
|
!!! related TS6500 file.tsx:32:64: The expected type comes from property 'y3' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number | undefined; y3: boolean; }'
|
|
+!!! related TS2771 file.tsx:32:18: The last overload is declared here.
|
|
const e2 = <TestingOptional y1="hello" y2={1000} y3 />
|
|
- ~~~~~~~~~~~~~~~
|
|
+ ~~
|
|
!!! error TS2769: No overload matches this call.
|
|
-!!! error TS2769: Overload 1 of 3, '(a: { y1?: string | undefined; y2?: number | undefined; }): Element', gave the following error.
|
|
-!!! error TS2769: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string | undefined; y2?: number | undefined; }'.
|
|
-!!! error TS2769: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string | undefined; y2?: number | undefined; }'.
|
|
-!!! error TS2769: Overload 2 of 3, '(a: { y1?: string | undefined; y2?: number | undefined; children: Element; }): Element', gave the following error.
|
|
-!!! error TS2769: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string | undefined; y2?: number | undefined; children: Element; }'.
|
|
-!!! error TS2769: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string | undefined; y2?: number | undefined; children: Element; }'.
|
|
-!!! error TS2769: Overload 3 of 3, '(a: { y1: boolean; y2?: number | undefined; y3: boolean; }): Element', gave the following error.
|
|
+!!! error TS2769: The last overload gave the following error.
|
|
!!! error TS2769: Type 'string' is not assignable to type 'boolean'.
|
|
!!! related TS6500 file.tsx:32:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number | undefined; y3: boolean; }'
|
|
+!!! related TS2771 file.tsx:32:18: The last overload is declared here.
|
|
const e3 = <TestingOptional y1="hello" y2={1000} children="hi" />
|
|
- ~~~~~~~~~~~~~~~
|
|
+ ~~
|
|
!!! error TS2769: No overload matches this call.
|
|
-!!! error TS2769: Overload 1 of 3, '(a: { y1?: string | undefined; y2?: number | undefined; }): Element', gave the following error.
|
|
-!!! error TS2769: Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string | undefined; y2?: number | undefined; }'.
|
|
-!!! error TS2769: Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string | undefined; y2?: number | undefined; }'.
|
|
-!!! error TS2769: Overload 2 of 3, '(a: { y1?: string | undefined; y2?: number | undefined; children: Element; }): Element', gave the following error.
|
|
-!!! error TS2769: Type 'string' is not assignable to type 'Element'.
|
|
-!!! error TS2769: Overload 3 of 3, '(a: { y1: boolean; y2?: number | undefined; y3: boolean; }): Element', gave the following error.
|
|
+!!! error TS2769: The last overload gave the following error.
|
|
!!! error TS2769: Type 'string' is not assignable to type 'boolean'.
|
|
-!!! related TS6500 file.tsx:31:64: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & { y1?: string | undefined; y2?: number | undefined; children: Element; }'
|
|
!!! related TS6500 file.tsx:32:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number | undefined; y3: boolean; }'
|
|
+!!! related TS2771 file.tsx:32:18: The last overload is declared here.
|
|
const e4 = <TestingOptional y1="hello" y2={1000}>Hi</TestingOptional>
|
|
- ~~~~~~~~~~~~~~~
|
|
+ ~~
|
|
!!! error TS2769: No overload matches this call.
|
|
-!!! error TS2769: Overload 1 of 3, '(a: { y1?: string | undefined; y2?: number | undefined; }): Element', gave the following error.
|
|
-!!! error TS2769: Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string | undefined; y2?: number | undefined; }'.
|
|
-!!! error TS2769: Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string | undefined; y2?: number | undefined; }'.
|
|
-!!! error TS2769: Overload 2 of 3, '(a: { y1?: string | undefined; y2?: number | undefined; children: Element; }): Element', gave the following error.
|
|
-!!! error TS2769: '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 TS2769: Overload 3 of 3, '(a: { y1: boolean; y2?: number | undefined; y3: boolean; }): Element', gave the following error.
|
|
+!!! error TS2769: The last overload gave the following error.
|
|
!!! error TS2769: Type 'string' is not assignable to type 'boolean'.
|
|
-!!! related TS6500 file.tsx:31:64: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & { y1?: string | undefined; y2?: number | undefined; children: Element; }'
|
|
!!! related TS6500 file.tsx:32:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number | undefined; y3: boolean; }'
|
|
+!!! related TS2771 file.tsx:32:18: The last overload is declared here.
|
|
|