|
3 | 3 | import React = require('react')
|
4 | 4 | >React : Symbol(React, Decl(file.tsx, 0, 0))
|
5 | 5 |
|
6 |
| - |
7 | 6 | declare function ComponentWithTwoAttributes<K,V>(l: {key1: K, value: V}): JSX.Element;
|
8 | 7 | >ComponentWithTwoAttributes : Symbol(ComponentWithTwoAttributes, Decl(file.tsx, 1, 31))
|
9 |
| ->K : Symbol(K, Decl(file.tsx, 4, 44)) |
10 |
| ->V : Symbol(V, Decl(file.tsx, 4, 46)) |
11 |
| ->l : Symbol(l, Decl(file.tsx, 4, 49)) |
12 |
| ->key1 : Symbol(key1, Decl(file.tsx, 4, 53)) |
13 |
| ->K : Symbol(K, Decl(file.tsx, 4, 44)) |
14 |
| ->value : Symbol(value, Decl(file.tsx, 4, 61)) |
15 |
| ->V : Symbol(V, Decl(file.tsx, 4, 46)) |
| 8 | +>K : Symbol(K, Decl(file.tsx, 3, 44)) |
| 9 | +>V : Symbol(V, Decl(file.tsx, 3, 46)) |
| 10 | +>l : Symbol(l, Decl(file.tsx, 3, 49)) |
| 11 | +>key1 : Symbol(key1, Decl(file.tsx, 3, 53)) |
| 12 | +>K : Symbol(K, Decl(file.tsx, 3, 44)) |
| 13 | +>value : Symbol(value, Decl(file.tsx, 3, 61)) |
| 14 | +>V : Symbol(V, Decl(file.tsx, 3, 46)) |
16 | 15 | >JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
|
17 | 16 | >Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
|
18 | 17 |
|
19 | 18 | // OK
|
20 | 19 | function Baz<T,U>(key1: T, value: U) {
|
21 |
| ->Baz : Symbol(Baz, Decl(file.tsx, 4, 86)) |
22 |
| ->T : Symbol(T, Decl(file.tsx, 7, 13)) |
23 |
| ->U : Symbol(U, Decl(file.tsx, 7, 15)) |
24 |
| ->key1 : Symbol(key1, Decl(file.tsx, 7, 18)) |
25 |
| ->T : Symbol(T, Decl(file.tsx, 7, 13)) |
26 |
| ->value : Symbol(value, Decl(file.tsx, 7, 26)) |
27 |
| ->U : Symbol(U, Decl(file.tsx, 7, 15)) |
| 20 | +>Baz : Symbol(Baz, Decl(file.tsx, 3, 86)) |
| 21 | +>T : Symbol(T, Decl(file.tsx, 6, 13)) |
| 22 | +>U : Symbol(U, Decl(file.tsx, 6, 15)) |
| 23 | +>key1 : Symbol(key1, Decl(file.tsx, 6, 18)) |
| 24 | +>T : Symbol(T, Decl(file.tsx, 6, 13)) |
| 25 | +>value : Symbol(value, Decl(file.tsx, 6, 26)) |
| 26 | +>U : Symbol(U, Decl(file.tsx, 6, 15)) |
28 | 27 |
|
29 | 28 | let a0 = <ComponentWithTwoAttributes key1={key1} value={value} />
|
30 |
| ->a0 : Symbol(a0, Decl(file.tsx, 8, 7)) |
| 29 | +>a0 : Symbol(a0, Decl(file.tsx, 7, 7)) |
31 | 30 | >ComponentWithTwoAttributes : Symbol(ComponentWithTwoAttributes, Decl(file.tsx, 1, 31))
|
32 |
| ->key1 : Symbol(key1, Decl(file.tsx, 8, 40)) |
33 |
| ->key1 : Symbol(key1, Decl(file.tsx, 7, 18)) |
34 |
| ->value : Symbol(value, Decl(file.tsx, 8, 52)) |
35 |
| ->value : Symbol(value, Decl(file.tsx, 7, 26)) |
| 31 | +>key1 : Symbol(key1, Decl(file.tsx, 7, 40)) |
| 32 | +>key1 : Symbol(key1, Decl(file.tsx, 6, 18)) |
| 33 | +>value : Symbol(value, Decl(file.tsx, 7, 52)) |
| 34 | +>value : Symbol(value, Decl(file.tsx, 6, 26)) |
36 | 35 |
|
37 | 36 | let a1 = <ComponentWithTwoAttributes {...{key1, value: value}} key="Component" />
|
38 |
| ->a1 : Symbol(a1, Decl(file.tsx, 9, 7)) |
| 37 | +>a1 : Symbol(a1, Decl(file.tsx, 8, 7)) |
39 | 38 | >ComponentWithTwoAttributes : Symbol(ComponentWithTwoAttributes, Decl(file.tsx, 1, 31))
|
40 |
| ->key1 : Symbol(key1, Decl(file.tsx, 9, 46)) |
41 |
| ->value : Symbol(value, Decl(file.tsx, 9, 51)) |
42 |
| ->value : Symbol(value, Decl(file.tsx, 7, 26)) |
43 |
| ->key : Symbol(key, Decl(file.tsx, 9, 66)) |
44 |
| -} |
45 |
| - |
46 |
| -// OK |
47 |
| -declare function Component<U>(l: U): JSX.Element; |
48 |
| ->Component : Symbol(Component, Decl(file.tsx, 10, 1)) |
49 |
| ->U : Symbol(U, Decl(file.tsx, 13, 27)) |
50 |
| ->l : Symbol(l, Decl(file.tsx, 13, 30)) |
51 |
| ->U : Symbol(U, Decl(file.tsx, 13, 27)) |
52 |
| ->JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1)) |
53 |
| ->Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27)) |
54 |
| - |
55 |
| -function createComponent<T extends {prop: number}>(arg:T) { |
56 |
| ->createComponent : Symbol(createComponent, Decl(file.tsx, 13, 49)) |
57 |
| ->T : Symbol(T, Decl(file.tsx, 14, 25)) |
58 |
| ->prop : Symbol(prop, Decl(file.tsx, 14, 36)) |
59 |
| ->arg : Symbol(arg, Decl(file.tsx, 14, 51)) |
60 |
| ->T : Symbol(T, Decl(file.tsx, 14, 25)) |
61 |
| - |
62 |
| - let a1 = <Component {...arg} />; |
63 |
| ->a1 : Symbol(a1, Decl(file.tsx, 15, 7)) |
64 |
| ->Component : Symbol(Component, Decl(file.tsx, 10, 1)) |
65 |
| ->arg : Symbol(arg, Decl(file.tsx, 14, 51)) |
66 |
| - |
67 |
| - let a2 = <Component {...arg} prop1 />; |
68 |
| ->a2 : Symbol(a2, Decl(file.tsx, 16, 7)) |
69 |
| ->Component : Symbol(Component, Decl(file.tsx, 10, 1)) |
70 |
| ->arg : Symbol(arg, Decl(file.tsx, 14, 51)) |
71 |
| ->prop1 : Symbol(prop1, Decl(file.tsx, 16, 32)) |
72 |
| -} |
73 |
| - |
74 |
| -declare function ComponentSpecific<U>(l: {prop: U}): JSX.Element; |
75 |
| ->ComponentSpecific : Symbol(ComponentSpecific, Decl(file.tsx, 17, 1)) |
76 |
| ->U : Symbol(U, Decl(file.tsx, 19, 35)) |
77 |
| ->l : Symbol(l, Decl(file.tsx, 19, 38)) |
78 |
| ->prop : Symbol(prop, Decl(file.tsx, 19, 42)) |
79 |
| ->U : Symbol(U, Decl(file.tsx, 19, 35)) |
80 |
| ->JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1)) |
81 |
| ->Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27)) |
82 |
| - |
83 |
| -declare function ComponentSpecific1<U>(l: {prop: U, "ignore-prop": number}): JSX.Element; |
84 |
| ->ComponentSpecific1 : Symbol(ComponentSpecific1, Decl(file.tsx, 19, 65)) |
85 |
| ->U : Symbol(U, Decl(file.tsx, 20, 36)) |
86 |
| ->l : Symbol(l, Decl(file.tsx, 20, 39)) |
87 |
| ->prop : Symbol(prop, Decl(file.tsx, 20, 43)) |
88 |
| ->U : Symbol(U, Decl(file.tsx, 20, 36)) |
89 |
| ->JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1)) |
90 |
| ->Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27)) |
91 |
| - |
92 |
| -// OK |
93 |
| -function Bar<T extends {prop: number}>(arg: T) { |
94 |
| ->Bar : Symbol(Bar, Decl(file.tsx, 20, 89)) |
95 |
| ->T : Symbol(T, Decl(file.tsx, 23, 13)) |
96 |
| ->prop : Symbol(prop, Decl(file.tsx, 23, 24)) |
97 |
| ->arg : Symbol(arg, Decl(file.tsx, 23, 39)) |
98 |
| ->T : Symbol(T, Decl(file.tsx, 23, 13)) |
99 |
| - |
100 |
| - let a1 = <ComponentSpecific {...arg} ignore-prop="hi" />; // U is number |
101 |
| ->a1 : Symbol(a1, Decl(file.tsx, 24, 7)) |
102 |
| ->ComponentSpecific : Symbol(ComponentSpecific, Decl(file.tsx, 17, 1)) |
103 |
| ->arg : Symbol(arg, Decl(file.tsx, 23, 39)) |
104 |
| ->ignore-prop : Symbol(ignore-prop, Decl(file.tsx, 24, 40)) |
105 |
| - |
106 |
| - let a2 = <ComponentSpecific1 {...arg} ignore-prop={10} />; // U is number |
107 |
| ->a2 : Symbol(a2, Decl(file.tsx, 25, 7)) |
108 |
| ->ComponentSpecific1 : Symbol(ComponentSpecific1, Decl(file.tsx, 19, 65)) |
109 |
| ->arg : Symbol(arg, Decl(file.tsx, 23, 39)) |
110 |
| ->ignore-prop : Symbol(ignore-prop, Decl(file.tsx, 25, 41)) |
111 |
| - |
112 |
| - let a3 = <ComponentSpecific {...arg} prop="hello" />; // U is "hello" |
113 |
| ->a3 : Symbol(a3, Decl(file.tsx, 26, 7)) |
114 |
| ->ComponentSpecific : Symbol(ComponentSpecific, Decl(file.tsx, 17, 1)) |
115 |
| ->arg : Symbol(arg, Decl(file.tsx, 23, 39)) |
116 |
| ->prop : Symbol(prop, Decl(file.tsx, 26, 40)) |
| 39 | +>key1 : Symbol(key1, Decl(file.tsx, 8, 46)) |
| 40 | +>value : Symbol(value, Decl(file.tsx, 8, 51)) |
| 41 | +>value : Symbol(value, Decl(file.tsx, 6, 26)) |
| 42 | +>key : Symbol(key, Decl(file.tsx, 8, 66)) |
117 | 43 | }
|
118 | 44 |
|
119 | 45 | declare function Link<U>(l: {func: (arg: U)=>void}): JSX.Element;
|
120 |
| ->Link : Symbol(Link, Decl(file.tsx, 27, 1)) |
121 |
| ->U : Symbol(U, Decl(file.tsx, 29, 22)) |
122 |
| ->l : Symbol(l, Decl(file.tsx, 29, 25)) |
123 |
| ->func : Symbol(func, Decl(file.tsx, 29, 29)) |
124 |
| ->arg : Symbol(arg, Decl(file.tsx, 29, 36)) |
125 |
| ->U : Symbol(U, Decl(file.tsx, 29, 22)) |
| 46 | +>Link : Symbol(Link, Decl(file.tsx, 9, 1)) |
| 47 | +>U : Symbol(U, Decl(file.tsx, 11, 22)) |
| 48 | +>l : Symbol(l, Decl(file.tsx, 11, 25)) |
| 49 | +>func : Symbol(func, Decl(file.tsx, 11, 29)) |
| 50 | +>arg : Symbol(arg, Decl(file.tsx, 11, 36)) |
| 51 | +>U : Symbol(U, Decl(file.tsx, 11, 22)) |
126 | 52 | >JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
|
127 | 53 | >Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
|
128 | 54 |
|
129 | 55 | // OK
|
130 | 56 | function createLink(func: (a: number)=>void) {
|
131 |
| ->createLink : Symbol(createLink, Decl(file.tsx, 29, 65)) |
132 |
| ->func : Symbol(func, Decl(file.tsx, 32, 20)) |
133 |
| ->a : Symbol(a, Decl(file.tsx, 32, 27)) |
| 57 | +>createLink : Symbol(createLink, Decl(file.tsx, 11, 65)) |
| 58 | +>func : Symbol(func, Decl(file.tsx, 14, 20)) |
| 59 | +>a : Symbol(a, Decl(file.tsx, 14, 27)) |
134 | 60 |
|
135 | 61 | let o = <Link func={func} />
|
136 |
| ->o : Symbol(o, Decl(file.tsx, 33, 7)) |
137 |
| ->Link : Symbol(Link, Decl(file.tsx, 27, 1)) |
138 |
| ->func : Symbol(func, Decl(file.tsx, 33, 17)) |
139 |
| ->func : Symbol(func, Decl(file.tsx, 32, 20)) |
| 62 | +>o : Symbol(o, Decl(file.tsx, 15, 7)) |
| 63 | +>Link : Symbol(Link, Decl(file.tsx, 9, 1)) |
| 64 | +>func : Symbol(func, Decl(file.tsx, 15, 17)) |
| 65 | +>func : Symbol(func, Decl(file.tsx, 14, 20)) |
140 | 66 | }
|
141 | 67 |
|
142 | 68 | function createLink1(func: (a: number)=>boolean) {
|
143 |
| ->createLink1 : Symbol(createLink1, Decl(file.tsx, 34, 1)) |
144 |
| ->func : Symbol(func, Decl(file.tsx, 36, 21)) |
145 |
| ->a : Symbol(a, Decl(file.tsx, 36, 28)) |
| 69 | +>createLink1 : Symbol(createLink1, Decl(file.tsx, 16, 1)) |
| 70 | +>func : Symbol(func, Decl(file.tsx, 18, 21)) |
| 71 | +>a : Symbol(a, Decl(file.tsx, 18, 28)) |
146 | 72 |
|
147 | 73 | let o = <Link func={func} />
|
148 |
| ->o : Symbol(o, Decl(file.tsx, 37, 7)) |
149 |
| ->Link : Symbol(Link, Decl(file.tsx, 27, 1)) |
150 |
| ->func : Symbol(func, Decl(file.tsx, 37, 17)) |
151 |
| ->func : Symbol(func, Decl(file.tsx, 36, 21)) |
| 74 | +>o : Symbol(o, Decl(file.tsx, 19, 7)) |
| 75 | +>Link : Symbol(Link, Decl(file.tsx, 9, 1)) |
| 76 | +>func : Symbol(func, Decl(file.tsx, 19, 17)) |
| 77 | +>func : Symbol(func, Decl(file.tsx, 18, 21)) |
| 78 | +} |
| 79 | + |
| 80 | +interface InferParamProp<T> { |
| 81 | +>InferParamProp : Symbol(InferParamProp, Decl(file.tsx, 20, 1)) |
| 82 | +>T : Symbol(T, Decl(file.tsx, 22, 25)) |
| 83 | + |
| 84 | + values: Array<T>; |
| 85 | +>values : Symbol(InferParamProp.values, Decl(file.tsx, 22, 29)) |
| 86 | +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) |
| 87 | +>T : Symbol(T, Decl(file.tsx, 22, 25)) |
| 88 | + |
| 89 | + selectHandler: (selectedVal: T) => void; |
| 90 | +>selectHandler : Symbol(InferParamProp.selectHandler, Decl(file.tsx, 23, 21)) |
| 91 | +>selectedVal : Symbol(selectedVal, Decl(file.tsx, 24, 20)) |
| 92 | +>T : Symbol(T, Decl(file.tsx, 22, 25)) |
152 | 93 | }
|
153 | 94 |
|
| 95 | +declare function InferParamComponent<T>(attr: InferParamProp<T>): JSX.Element; |
| 96 | +>InferParamComponent : Symbol(InferParamComponent, Decl(file.tsx, 25, 1)) |
| 97 | +>T : Symbol(T, Decl(file.tsx, 27, 37)) |
| 98 | +>attr : Symbol(attr, Decl(file.tsx, 27, 40)) |
| 99 | +>InferParamProp : Symbol(InferParamProp, Decl(file.tsx, 20, 1)) |
| 100 | +>T : Symbol(T, Decl(file.tsx, 27, 37)) |
| 101 | +>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1)) |
| 102 | +>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27)) |
| 103 | + |
| 104 | +// OK |
| 105 | +let i = <InferParamComponent values={[1, 2, 3, 4]} selectHandler={(val) => { }} />; |
| 106 | +>i : Symbol(i, Decl(file.tsx, 30, 3)) |
| 107 | +>InferParamComponent : Symbol(InferParamComponent, Decl(file.tsx, 25, 1)) |
| 108 | +>values : Symbol(values, Decl(file.tsx, 30, 28)) |
| 109 | +>selectHandler : Symbol(selectHandler, Decl(file.tsx, 30, 50)) |
| 110 | +>val : Symbol(val, Decl(file.tsx, 30, 67)) |
154 | 111 |
|
0 commit comments