|
1 | 1 | === tests/cases/conformance/jsx/file.tsx === |
2 | | - |
3 | 2 | import React = require('react') |
4 | 3 | >React : Symbol(React, Decl(file.tsx, 0, 0)) |
5 | 4 |
|
6 | 5 | declare function OverloadComponent<U>(): JSX.Element; |
7 | | ->OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 53), Decl(file.tsx, 4, 101)) |
8 | | ->U : Symbol(U, Decl(file.tsx, 3, 35)) |
| 6 | +>OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 0, 31), Decl(file.tsx, 2, 53), Decl(file.tsx, 3, 101)) |
| 7 | +>U : Symbol(U, Decl(file.tsx, 2, 35)) |
9 | 8 | >JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1)) |
10 | 9 | >Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27)) |
11 | 10 |
|
12 | 11 | declare function OverloadComponent<U>(attr: {b: U, a?: string, "ignore-prop": boolean}): JSX.Element; |
13 | | ->OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 53), Decl(file.tsx, 4, 101)) |
14 | | ->U : Symbol(U, Decl(file.tsx, 4, 35)) |
15 | | ->attr : Symbol(attr, Decl(file.tsx, 4, 38)) |
16 | | ->b : Symbol(b, Decl(file.tsx, 4, 45)) |
17 | | ->U : Symbol(U, Decl(file.tsx, 4, 35)) |
18 | | ->a : Symbol(a, Decl(file.tsx, 4, 50)) |
| 12 | +>OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 0, 31), Decl(file.tsx, 2, 53), Decl(file.tsx, 3, 101)) |
| 13 | +>U : Symbol(U, Decl(file.tsx, 3, 35)) |
| 14 | +>attr : Symbol(attr, Decl(file.tsx, 3, 38)) |
| 15 | +>b : Symbol(b, Decl(file.tsx, 3, 45)) |
| 16 | +>U : Symbol(U, Decl(file.tsx, 3, 35)) |
| 17 | +>a : Symbol(a, Decl(file.tsx, 3, 50)) |
19 | 18 | >JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1)) |
20 | 19 | >Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27)) |
21 | 20 |
|
22 | 21 | declare function OverloadComponent<T, U>(attr: {b: U, a: T}): JSX.Element; |
23 | | ->OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 53), Decl(file.tsx, 4, 101)) |
24 | | ->T : Symbol(T, Decl(file.tsx, 5, 35)) |
25 | | ->U : Symbol(U, Decl(file.tsx, 5, 37)) |
26 | | ->attr : Symbol(attr, Decl(file.tsx, 5, 41)) |
27 | | ->b : Symbol(b, Decl(file.tsx, 5, 48)) |
28 | | ->U : Symbol(U, Decl(file.tsx, 5, 37)) |
29 | | ->a : Symbol(a, Decl(file.tsx, 5, 53)) |
30 | | ->T : Symbol(T, Decl(file.tsx, 5, 35)) |
| 22 | +>OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 0, 31), Decl(file.tsx, 2, 53), Decl(file.tsx, 3, 101)) |
| 23 | +>T : Symbol(T, Decl(file.tsx, 4, 35)) |
| 24 | +>U : Symbol(U, Decl(file.tsx, 4, 37)) |
| 25 | +>attr : Symbol(attr, Decl(file.tsx, 4, 41)) |
| 26 | +>b : Symbol(b, Decl(file.tsx, 4, 48)) |
| 27 | +>U : Symbol(U, Decl(file.tsx, 4, 37)) |
| 28 | +>a : Symbol(a, Decl(file.tsx, 4, 53)) |
| 29 | +>T : Symbol(T, Decl(file.tsx, 4, 35)) |
31 | 30 | >JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1)) |
32 | 31 | >Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27)) |
33 | 32 |
|
34 | 33 | // OK |
35 | 34 | function Baz<T extends {b: number}, U extends {a: boolean, b:string}>(arg1: T, arg2: U) { |
36 | | ->Baz : Symbol(Baz, Decl(file.tsx, 5, 74)) |
37 | | ->T : Symbol(T, Decl(file.tsx, 8, 13)) |
38 | | ->b : Symbol(b, Decl(file.tsx, 8, 24)) |
39 | | ->U : Symbol(U, Decl(file.tsx, 8, 35)) |
40 | | ->a : Symbol(a, Decl(file.tsx, 8, 47)) |
41 | | ->b : Symbol(b, Decl(file.tsx, 8, 58)) |
42 | | ->arg1 : Symbol(arg1, Decl(file.tsx, 8, 70)) |
43 | | ->T : Symbol(T, Decl(file.tsx, 8, 13)) |
44 | | ->arg2 : Symbol(arg2, Decl(file.tsx, 8, 78)) |
45 | | ->U : Symbol(U, Decl(file.tsx, 8, 35)) |
| 35 | +>Baz : Symbol(Baz, Decl(file.tsx, 4, 74)) |
| 36 | +>T : Symbol(T, Decl(file.tsx, 7, 13)) |
| 37 | +>b : Symbol(b, Decl(file.tsx, 7, 24)) |
| 38 | +>U : Symbol(U, Decl(file.tsx, 7, 35)) |
| 39 | +>a : Symbol(a, Decl(file.tsx, 7, 47)) |
| 40 | +>b : Symbol(b, Decl(file.tsx, 7, 58)) |
| 41 | +>arg1 : Symbol(arg1, Decl(file.tsx, 7, 70)) |
| 42 | +>T : Symbol(T, Decl(file.tsx, 7, 13)) |
| 43 | +>arg2 : Symbol(arg2, Decl(file.tsx, 7, 78)) |
| 44 | +>U : Symbol(U, Decl(file.tsx, 7, 35)) |
46 | 45 |
|
47 | 46 | let a0 = <OverloadComponent {...arg1} a="hello" ignore-prop />; |
48 | | ->a0 : Symbol(a0, Decl(file.tsx, 9, 7)) |
49 | | ->OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 53), Decl(file.tsx, 4, 101)) |
50 | | ->arg1 : Symbol(arg1, Decl(file.tsx, 8, 70)) |
51 | | ->a : Symbol(a, Decl(file.tsx, 9, 41)) |
52 | | ->ignore-prop : Symbol(ignore-prop, Decl(file.tsx, 9, 51)) |
| 47 | +>a0 : Symbol(a0, Decl(file.tsx, 8, 7)) |
| 48 | +>OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 0, 31), Decl(file.tsx, 2, 53), Decl(file.tsx, 3, 101)) |
| 49 | +>arg1 : Symbol(arg1, Decl(file.tsx, 7, 70)) |
| 50 | +>a : Symbol(a, Decl(file.tsx, 8, 41)) |
| 51 | +>ignore-prop : Symbol(ignore-prop, Decl(file.tsx, 8, 51)) |
53 | 52 |
|
54 | 53 | let a1 = <OverloadComponent {...arg2} ignore-pro="hello world" />; |
55 | | ->a1 : Symbol(a1, Decl(file.tsx, 10, 7)) |
56 | | ->OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 53), Decl(file.tsx, 4, 101)) |
57 | | ->arg2 : Symbol(arg2, Decl(file.tsx, 8, 78)) |
58 | | ->ignore-pro : Symbol(ignore-pro, Decl(file.tsx, 10, 41)) |
| 54 | +>a1 : Symbol(a1, Decl(file.tsx, 9, 7)) |
| 55 | +>OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 0, 31), Decl(file.tsx, 2, 53), Decl(file.tsx, 3, 101)) |
| 56 | +>arg2 : Symbol(arg2, Decl(file.tsx, 7, 78)) |
| 57 | +>ignore-pro : Symbol(ignore-pro, Decl(file.tsx, 9, 41)) |
59 | 58 |
|
60 | 59 | let a2 = <OverloadComponent {...arg2} />; |
61 | | ->a2 : Symbol(a2, Decl(file.tsx, 11, 7)) |
62 | | ->OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 53), Decl(file.tsx, 4, 101)) |
63 | | ->arg2 : Symbol(arg2, Decl(file.tsx, 8, 78)) |
| 60 | +>a2 : Symbol(a2, Decl(file.tsx, 10, 7)) |
| 61 | +>OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 0, 31), Decl(file.tsx, 2, 53), Decl(file.tsx, 3, 101)) |
| 62 | +>arg2 : Symbol(arg2, Decl(file.tsx, 7, 78)) |
64 | 63 |
|
65 | 64 | let a3 = <OverloadComponent {...arg1} ignore-prop />; |
66 | | ->a3 : Symbol(a3, Decl(file.tsx, 12, 7)) |
67 | | ->OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 53), Decl(file.tsx, 4, 101)) |
68 | | ->arg1 : Symbol(arg1, Decl(file.tsx, 8, 70)) |
69 | | ->ignore-prop : Symbol(ignore-prop, Decl(file.tsx, 12, 41)) |
| 65 | +>a3 : Symbol(a3, Decl(file.tsx, 11, 7)) |
| 66 | +>OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 0, 31), Decl(file.tsx, 2, 53), Decl(file.tsx, 3, 101)) |
| 67 | +>arg1 : Symbol(arg1, Decl(file.tsx, 7, 70)) |
| 68 | +>ignore-prop : Symbol(ignore-prop, Decl(file.tsx, 11, 41)) |
70 | 69 |
|
71 | 70 | let a4 = <OverloadComponent />; |
72 | | ->a4 : Symbol(a4, Decl(file.tsx, 13, 7)) |
73 | | ->OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 53), Decl(file.tsx, 4, 101)) |
| 71 | +>a4 : Symbol(a4, Decl(file.tsx, 12, 7)) |
| 72 | +>OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 0, 31), Decl(file.tsx, 2, 53), Decl(file.tsx, 3, 101)) |
74 | 73 |
|
75 | 74 | let a5 = <OverloadComponent {...arg2} ignore-prop="hello" {...arg1} />; |
76 | | ->a5 : Symbol(a5, Decl(file.tsx, 14, 7)) |
77 | | ->OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 53), Decl(file.tsx, 4, 101)) |
78 | | ->arg2 : Symbol(arg2, Decl(file.tsx, 8, 78)) |
79 | | ->ignore-prop : Symbol(ignore-prop, Decl(file.tsx, 14, 41)) |
80 | | ->arg1 : Symbol(arg1, Decl(file.tsx, 8, 70)) |
| 75 | +>a5 : Symbol(a5, Decl(file.tsx, 13, 7)) |
| 76 | +>OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 0, 31), Decl(file.tsx, 2, 53), Decl(file.tsx, 3, 101)) |
| 77 | +>arg2 : Symbol(arg2, Decl(file.tsx, 7, 78)) |
| 78 | +>ignore-prop : Symbol(ignore-prop, Decl(file.tsx, 13, 41)) |
| 79 | +>arg1 : Symbol(arg1, Decl(file.tsx, 7, 70)) |
81 | 80 |
|
82 | 81 | let a6 = <OverloadComponent {...arg2} ignore-prop {...arg1} />; |
83 | | ->a6 : Symbol(a6, Decl(file.tsx, 15, 7)) |
84 | | ->OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 53), Decl(file.tsx, 4, 101)) |
85 | | ->arg2 : Symbol(arg2, Decl(file.tsx, 8, 78)) |
86 | | ->ignore-prop : Symbol(ignore-prop, Decl(file.tsx, 15, 41)) |
87 | | ->arg1 : Symbol(arg1, Decl(file.tsx, 8, 70)) |
| 82 | +>a6 : Symbol(a6, Decl(file.tsx, 14, 7)) |
| 83 | +>OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 0, 31), Decl(file.tsx, 2, 53), Decl(file.tsx, 3, 101)) |
| 84 | +>arg2 : Symbol(arg2, Decl(file.tsx, 7, 78)) |
| 85 | +>ignore-prop : Symbol(ignore-prop, Decl(file.tsx, 14, 41)) |
| 86 | +>arg1 : Symbol(arg1, Decl(file.tsx, 7, 70)) |
88 | 87 | } |
89 | 88 |
|
90 | 89 | declare function Link<U>(l: {func: (arg: U)=>void}): JSX.Element; |
91 | | ->Link : Symbol(Link, Decl(file.tsx, 16, 1), Decl(file.tsx, 18, 65)) |
92 | | ->U : Symbol(U, Decl(file.tsx, 18, 22)) |
93 | | ->l : Symbol(l, Decl(file.tsx, 18, 25)) |
94 | | ->func : Symbol(func, Decl(file.tsx, 18, 29)) |
95 | | ->arg : Symbol(arg, Decl(file.tsx, 18, 36)) |
96 | | ->U : Symbol(U, Decl(file.tsx, 18, 22)) |
| 90 | +>Link : Symbol(Link, Decl(file.tsx, 15, 1), Decl(file.tsx, 17, 65)) |
| 91 | +>U : Symbol(U, Decl(file.tsx, 17, 22)) |
| 92 | +>l : Symbol(l, Decl(file.tsx, 17, 25)) |
| 93 | +>func : Symbol(func, Decl(file.tsx, 17, 29)) |
| 94 | +>arg : Symbol(arg, Decl(file.tsx, 17, 36)) |
| 95 | +>U : Symbol(U, Decl(file.tsx, 17, 22)) |
97 | 96 | >JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1)) |
98 | 97 | >Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27)) |
99 | 98 |
|
100 | 99 | declare function Link<U>(l: {func: (arg1:U, arg2: string)=>void}): JSX.Element; |
101 | | ->Link : Symbol(Link, Decl(file.tsx, 16, 1), Decl(file.tsx, 18, 65)) |
102 | | ->U : Symbol(U, Decl(file.tsx, 19, 22)) |
103 | | ->l : Symbol(l, Decl(file.tsx, 19, 25)) |
104 | | ->func : Symbol(func, Decl(file.tsx, 19, 29)) |
105 | | ->arg1 : Symbol(arg1, Decl(file.tsx, 19, 36)) |
106 | | ->U : Symbol(U, Decl(file.tsx, 19, 22)) |
107 | | ->arg2 : Symbol(arg2, Decl(file.tsx, 19, 43)) |
| 100 | +>Link : Symbol(Link, Decl(file.tsx, 15, 1), Decl(file.tsx, 17, 65)) |
| 101 | +>U : Symbol(U, Decl(file.tsx, 18, 22)) |
| 102 | +>l : Symbol(l, Decl(file.tsx, 18, 25)) |
| 103 | +>func : Symbol(func, Decl(file.tsx, 18, 29)) |
| 104 | +>arg1 : Symbol(arg1, Decl(file.tsx, 18, 36)) |
| 105 | +>U : Symbol(U, Decl(file.tsx, 18, 22)) |
| 106 | +>arg2 : Symbol(arg2, Decl(file.tsx, 18, 43)) |
108 | 107 | >JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1)) |
109 | 108 | >Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27)) |
110 | 109 |
|
111 | 110 | function createLink(func: (a: number)=>void) { |
112 | | ->createLink : Symbol(createLink, Decl(file.tsx, 19, 79)) |
113 | | ->func : Symbol(func, Decl(file.tsx, 20, 20)) |
114 | | ->a : Symbol(a, Decl(file.tsx, 20, 27)) |
| 111 | +>createLink : Symbol(createLink, Decl(file.tsx, 18, 79)) |
| 112 | +>func : Symbol(func, Decl(file.tsx, 19, 20)) |
| 113 | +>a : Symbol(a, Decl(file.tsx, 19, 27)) |
115 | 114 |
|
116 | 115 | let o = <Link func={func} /> |
117 | | ->o : Symbol(o, Decl(file.tsx, 21, 7)) |
118 | | ->Link : Symbol(Link, Decl(file.tsx, 16, 1), Decl(file.tsx, 18, 65)) |
119 | | ->func : Symbol(func, Decl(file.tsx, 21, 17)) |
120 | | ->func : Symbol(func, Decl(file.tsx, 20, 20)) |
| 116 | +>o : Symbol(o, Decl(file.tsx, 20, 7)) |
| 117 | +>Link : Symbol(Link, Decl(file.tsx, 15, 1), Decl(file.tsx, 17, 65)) |
| 118 | +>func : Symbol(func, Decl(file.tsx, 20, 17)) |
| 119 | +>func : Symbol(func, Decl(file.tsx, 19, 20)) |
121 | 120 |
|
122 | 121 | let o1 = <Link func={(a:number, b:string)=>{}} />; |
123 | | ->o1 : Symbol(o1, Decl(file.tsx, 22, 7)) |
124 | | ->Link : Symbol(Link, Decl(file.tsx, 16, 1), Decl(file.tsx, 18, 65)) |
125 | | ->func : Symbol(func, Decl(file.tsx, 22, 18)) |
126 | | ->a : Symbol(a, Decl(file.tsx, 22, 26)) |
127 | | ->b : Symbol(b, Decl(file.tsx, 22, 35)) |
| 122 | +>o1 : Symbol(o1, Decl(file.tsx, 21, 7)) |
| 123 | +>Link : Symbol(Link, Decl(file.tsx, 15, 1), Decl(file.tsx, 17, 65)) |
| 124 | +>func : Symbol(func, Decl(file.tsx, 21, 18)) |
| 125 | +>a : Symbol(a, Decl(file.tsx, 21, 26)) |
| 126 | +>b : Symbol(b, Decl(file.tsx, 21, 35)) |
128 | 127 | } |
0 commit comments