File: tsxUnionElementType3.types

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (111 lines) | stat: -rw-r--r-- 2,280 bytes parent folder | download | duplicates (5)
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
=== tests/cases/conformance/jsx/file.tsx ===
import React = require('react');
>React : typeof React

class RC1 extends React.Component<{x : number}, {}> {
>RC1 : RC1
>React.Component : React.Component<{ x: number; }, {}>
>React : typeof React
>Component : typeof React.Component
>x : number

    render() {
>render : () => any

        return null;
>null : null
    }
}

class RC2 extends React.Component<{ x: string }, {}> {
>RC2 : RC2
>React.Component : React.Component<{ x: string; }, {}>
>React : typeof React
>Component : typeof React.Component
>x : string

    render() {
>render : () => any

        return null;
>null : null
    }
    private method() { }
>method : () => void
}

class RC3 extends React.Component<{}, {}> {
>RC3 : RC3
>React.Component : React.Component<{}, {}>
>React : typeof React
>Component : typeof React.Component

    render() {
>render : () => any

        return null;
>null : null
    }
}

class RC4 extends React.Component<{}, {}> {
>RC4 : RC4
>React.Component : React.Component<{}, {}>
>React : typeof React
>Component : typeof React.Component

    render() {
>render : () => any

        return null;
>null : null
    }
}

var EmptyRCComp = RC3 || RC4;
>EmptyRCComp : typeof RC3
>RC3 || RC4 : typeof RC3
>RC3 : typeof RC3
>RC4 : typeof RC4

var PartRCComp = RC1 || RC4;
>PartRCComp : typeof RC4
>RC1 || RC4 : typeof RC4
>RC1 : typeof RC1
>RC4 : typeof RC4

var RCComp = RC1 || RC2;
>RCComp : typeof RC1 | typeof RC2
>RC1 || RC2 : typeof RC1 | typeof RC2
>RC1 : typeof RC1
>RC2 : typeof RC2

// OK
let a = <RCComp x="Hi" />;
>a : JSX.Element
><RCComp x="Hi" /> : JSX.Element
>RCComp : typeof RC1 | typeof RC2
>x : string

let a1 = <EmptyRCComp />;
>a1 : JSX.Element
><EmptyRCComp /> : JSX.Element
>EmptyRCComp : typeof RC3

let a2 = <EmptyRCComp data-prop="hello" />;
>a2 : JSX.Element
><EmptyRCComp data-prop="hello" /> : JSX.Element
>EmptyRCComp : typeof RC3
>data-prop : string

let b = <PartRCComp />
>b : JSX.Element
><PartRCComp /> : JSX.Element
>PartRCComp : typeof RC4

let c = <PartRCComp data-extra="hello" />
>c : JSX.Element
><PartRCComp data-extra="hello" /> : JSX.Element
>PartRCComp : typeof RC4
>data-extra : string