File: tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (24 lines) | stat: -rw-r--r-- 1,650 bytes parent folder | download
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.
    }