1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
|
tests/cases/conformance/jsx/file.tsx(12,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.
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 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.
Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'.
tests/cases/conformance/jsx/file.tsx(14,31): error TS2769: 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 'boolean' is not assignable to type 'string'.
tests/cases/conformance/jsx/file.tsx(16,31): error TS2769: 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,13): error TS2769: 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,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; }): 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 TS2769: No overload matches this call.
Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error.
Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'.
Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'.
Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/jsx/file.tsx(33,12): error TS2769: No overload matches this call.
Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error.
Type 'boolean' is not assignable to type 'string'.
Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error.
Type 'boolean' is not assignable to type 'string'.
Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error.
Type 'string' is not assignable to type 'boolean'.
tests/cases/conformance/jsx/file.tsx(34,12): error TS2769: No overload matches this call.
Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error.
Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
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 TS2769: No overload matches this call.
Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error.
Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
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 TS2769: No overload matches this call.
Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error.
Type '{ children: string; y1: string; y2: number; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
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) ====
import React = require('react')
declare function OneThing(): JSX.Element;
declare function OneThing(l: {yy: number, yy1: string}): JSX.Element;
let obj = {
yy: 10,
yy1: "hello"
}
let obj2: any;
// Error
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: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
!!! error TS2769: Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
const c1 = <OneThing yy={10}/>; // missing property;
~~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769: Overload 1 of 2, '(): Element', gave the following error.
!!! error TS2769: Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'.
!!! 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: Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'.
!!! related TS2728 tests/cases/conformance/jsx/file.tsx:3:43: 'yy1' 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 '{ yy1: true; yy: number; }' 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: Type 'boolean' is not assignable to type 'string'.
!!! related TS6500 tests/cases/conformance/jsx/file.tsx:3:43: The expected type comes from property 'yy1' which is declared here on type 'IntrinsicAttributes & { yy: number; yy1: string; }'
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 '{ y1: number; yy: number; yy1: string; }' 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: Type '{ y1: number; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
!!! error TS2769: Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
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 '{ yy: boolean; yy1: string; }' 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: Type '{ yy: boolean; yy1: string; }' 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'.
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
declare function TestingOneThing(j: {"extra-data": string}): JSX.Element;
declare function TestingOneThing(n: {yy: string, direction?: number}): JSX.Element;
// Error
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; }): Element', gave the following error.
!!! error TS2769: Property 'yy' is missing in type '{ "extra-data": true; }' but required in type '{ yy: string; direction?: number; }'.
!!! related TS2728 tests/cases/conformance/jsx/file.tsx:22:38: 'yy' is declared here.
const d2 = <TestingOneThing yy="hello" direction="left" />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error.
!!! error TS2769: Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'.
!!! error TS2769: Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'.
!!! error TS2769: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error.
!!! error TS2769: Type 'string' is not assignable to type 'number'.
!!! related TS6500 tests/cases/conformance/jsx/file.tsx:22:50: The expected type comes from property 'direction' which is declared here on type 'IntrinsicAttributes & { yy: string; direction?: number; }'
declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element;
declare function TestingOptional(a: {y1?: string, y2?: number, children: JSX.Element}): JSX.Element;
declare function TestingOptional(a: {y1: boolean, y2?: number, y3: boolean}): JSX.Element;
// Error
const e1 = <TestingOptional y1 y3="hello"/>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error.
!!! error TS2769: Type 'boolean' is not assignable to type 'string'.
!!! error TS2769: Overload 2 of 3, '(a: { y1?: string; y2?: number; 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; y3: boolean; }): Element', gave the following error.
!!! error TS2769: Type 'string' is not assignable to type 'boolean'.
!!! related TS6500 tests/cases/conformance/jsx/file.tsx:28:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'
!!! related TS6500 tests/cases/conformance/jsx/file.tsx:29:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'
!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:64: The expected type comes from property 'y3' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }'
const e2 = <TestingOptional y1="hello" y2={1000} y3 />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error.
!!! error TS2769: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
!!! error TS2769: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
!!! error TS2769: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error.
!!! error TS2769: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'.
!!! error TS2769: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'.
!!! error TS2769: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error.
!!! error TS2769: Type 'string' is not assignable to type 'boolean'.
!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }'
const e3 = <TestingOptional y1="hello" y2={1000} children="hi" />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error.
!!! error TS2769: Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
!!! error TS2769: Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
!!! error TS2769: Overload 2 of 3, '(a: { y1?: string; y2?: number; 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; y3: boolean; }): Element', gave the following error.
!!! error TS2769: Type 'string' is not assignable to type 'boolean'.
!!! related TS6500 tests/cases/conformance/jsx/file.tsx:29:64: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'
!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }'
const e4 = <TestingOptional y1="hello" y2={1000}>Hi</TestingOptional>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error.
!!! error TS2769: Type '{ children: string; y1: string; y2: number; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
!!! error TS2769: Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'.
!!! error TS2769: Overload 2 of 3, '(a: { y1?: string; y2?: number; 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; y3: boolean; }): Element', gave the following error.
!!! error TS2769: Type 'string' is not assignable to type 'boolean'.
!!! related TS6500 tests/cases/conformance/jsx/file.tsx:29:64: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'
!!! related TS6500 tests/cases/conformance/jsx/file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }'
|