58 lines
2.4 KiB
Plaintext
58 lines
2.4 KiB
Plaintext
tests/cases/conformance/jsx/tsxAttributeResolution1.tsx(23,8): error TS2322: Type 'string' is not assignable to type 'number'.
|
|
tests/cases/conformance/jsx/tsxAttributeResolution1.tsx(24,8): error TS2339: Property 'y' does not exist on type 'Attribs1'.
|
|
tests/cases/conformance/jsx/tsxAttributeResolution1.tsx(25,8): error TS2339: Property 'y' does not exist on type 'Attribs1'.
|
|
tests/cases/conformance/jsx/tsxAttributeResolution1.tsx(26,8): error TS2322: Type 'string' is not assignable to type 'number'.
|
|
tests/cases/conformance/jsx/tsxAttributeResolution1.tsx(27,8): error TS2339: Property 'var' does not exist on type 'Attribs1'.
|
|
tests/cases/conformance/jsx/tsxAttributeResolution1.tsx(29,1): error TS2324: Property 'reqd' is missing in type '{ reqd: string; }'.
|
|
tests/cases/conformance/jsx/tsxAttributeResolution1.tsx(30,8): error TS2322: Type 'number' is not assignable to type 'string'.
|
|
|
|
|
|
==== tests/cases/conformance/jsx/tsxAttributeResolution1.tsx (7 errors) ====
|
|
declare module JSX {
|
|
interface Element { }
|
|
interface IntrinsicElements {
|
|
test1: Attribs1;
|
|
test2: { reqd: string };
|
|
var: { var: string };
|
|
}
|
|
}
|
|
interface Attribs1 {
|
|
x?: number;
|
|
s?: string;
|
|
}
|
|
|
|
// OK
|
|
<test1 x={0} />; // OK
|
|
<test1 />; // OK
|
|
<test1 data-x={true} />; // OK
|
|
|
|
<test2 reqd='true' />; // OK
|
|
<test2 reqd={'true'} />; // OK
|
|
|
|
// Errors
|
|
<test1 x={'0'} />; // Error, '0' is not number
|
|
~~~~~~~
|
|
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
|
<test1 y={0} />; // Error, no property "y"
|
|
~
|
|
!!! error TS2339: Property 'y' does not exist on type 'Attribs1'.
|
|
<test1 y="foo" />; // Error, no property "y"
|
|
~
|
|
!!! error TS2339: Property 'y' does not exist on type 'Attribs1'.
|
|
<test1 x="32" />; // Error, "32" is not number
|
|
~~~~~~
|
|
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
|
<test1 var="10" />; // Error, no 'var' property
|
|
~~~
|
|
!!! error TS2339: Property 'var' does not exist on type 'Attribs1'.
|
|
|
|
<test2 />; // Error, missing reqd
|
|
~~~~~~~~~
|
|
!!! error TS2324: Property 'reqd' is missing in type '{ reqd: string; }'.
|
|
<test2 reqd={10} />; // Error, reqd is not string
|
|
~~~~~~~~~
|
|
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
|
|
|
// Should be OK
|
|
<var var='var' />;
|
|
|