1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
tests/cases/conformance/jsx/file.tsx(9,15): error TS2741: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: {}; a: number; }'.
tests/cases/conformance/jsx/file.tsx(10,15): error TS2322: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: {}; a: {}; }'.
Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: {}; a: {}; }'.
==== tests/cases/conformance/jsx/file.tsx (2 errors) ====
import React = require('react')
declare function OverloadComponent<U>(): JSX.Element;
declare function OverloadComponent<U>(attr: {b: U, a: string, "ignore-prop": boolean}): JSX.Element;
declare function OverloadComponent<T, U>(attr: {b: U, a: T}): JSX.Element;
// Error
function Baz<T extends {b: number}, U extends {a: boolean, b:string}>(arg1: T, arg2: U) {
let a0 = <OverloadComponent a={arg1.b}/>
~~~~~~~~~~~~~~~~~
!!! error TS2741: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: {}; a: number; }'.
!!! related TS2728 tests/cases/conformance/jsx/file.tsx:5:49: 'b' is declared here.
let a2 = <OverloadComponent {...arg1} ignore-prop /> // missing a
~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'T & { ignore-prop: true; }' is not assignable to type 'IntrinsicAttributes & { b: {}; a: {}; }'.
!!! error TS2322: Property 'a' is missing in type '{ b: number; } & { ignore-prop: true; }' but required in type '{ b: {}; a: {}; }'.
!!! related TS2728 tests/cases/conformance/jsx/file.tsx:5:55: 'a' is declared here.
}
|