forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexcessiveStackDepthFlatArray.types
163 lines (140 loc) · 5.93 KB
/
excessiveStackDepthFlatArray.types
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
//// [tests/cases/compiler/excessiveStackDepthFlatArray.ts] ////
=== Performance Stats ===
Type Count: 1,000
Instantiation count: 1,000
=== index.tsx ===
interface MiddlewareArray<T> extends Array<T> {}
declare function configureStore(options: { middleware: MiddlewareArray<any> }): void;
>configureStore : (options: { middleware: MiddlewareArray<any>; }) => void
> : ^ ^^ ^^^^^
>options : { middleware: MiddlewareArray<any>; }
> : ^^^^^^^^^^^^^^ ^^^
>middleware : MiddlewareArray<any>
> : ^^^^^^^^^^^^^^^^^^^^
declare const defaultMiddleware: MiddlewareArray<any>;
>defaultMiddleware : MiddlewareArray<any>
> : ^^^^^^^^^^^^^^^^^^^^
configureStore({
>configureStore({ middleware: [...defaultMiddleware], // Should not error}) : void
> : ^^^^
>configureStore : (options: { middleware: MiddlewareArray<any>; }) => void
> : ^ ^^ ^^^^^
>{ middleware: [...defaultMiddleware], // Should not error} : { middleware: any[]; }
> : ^^^^^^^^^^^^^^^^^^^^^^
middleware: [...defaultMiddleware], // Should not error
>middleware : any[]
> : ^^^^^
>[...defaultMiddleware] : any[]
> : ^^^^^
>...defaultMiddleware : any
> : ^^^
>defaultMiddleware : MiddlewareArray<any>
> : ^^^^^^^^^^^^^^^^^^^^
});
declare namespace React {
type DetailedHTMLProps<E extends HTMLAttributes<T>, T> = E;
>DetailedHTMLProps : E
> : ^
interface HTMLAttributes<T> {
children?: ReactNode;
>children : ReactNode
> : ^^^^^^^^^
}
type ReactNode = ReactChild | ReactFragment | boolean | null | undefined;
>ReactNode : ReactNode
> : ^^^^^^^^^
type ReactText = string | number;
>ReactText : ReactText
> : ^^^^^^^^^
type ReactChild = ReactText;
>ReactChild : ReactText
> : ^^^^^^^^^
type ReactFragment = {} | ReactNodeArray;
>ReactFragment : ReactFragment
> : ^^^^^^^^^^^^^
interface ReactNodeArray extends Array<ReactNode> {}
}
declare namespace JSX {
interface IntrinsicElements {
ul: React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>;
>ul : React.HTMLAttributes<HTMLUListElement>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>React : any
> : ^^^
>React : any
> : ^^^
li: React.DetailedHTMLProps<React.HTMLAttributes<HTMLLIElement>, HTMLLIElement>;
>li : React.HTMLAttributes<HTMLLIElement>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>React : any
> : ^^^
>React : any
> : ^^^
}
}
declare var React: any;
>React : any
> : ^^^
const Component = () => {
>Component : () => any
> : ^^^^^^^^^
>() => { const categories = ['Fruit', 'Vegetables']; return ( <ul> <li>All</li> {categories.map((category) => ( <li key={category}>{category}</li> // Error about 'key' only ))} </ul> );} : () => any
> : ^^^^^^^^^
const categories = ['Fruit', 'Vegetables'];
>categories : string[]
> : ^^^^^^^^
>['Fruit', 'Vegetables'] : string[]
> : ^^^^^^^^
>'Fruit' : "Fruit"
> : ^^^^^^^
>'Vegetables' : "Vegetables"
> : ^^^^^^^^^^^^
return (
>( <ul> <li>All</li> {categories.map((category) => ( <li key={category}>{category}</li> // Error about 'key' only ))} </ul> ) : any
> : ^^^
<ul>
><ul> <li>All</li> {categories.map((category) => ( <li key={category}>{category}</li> // Error about 'key' only ))} </ul> : any
> : ^^^
>ul : any
> : ^^^
<li>All</li>
><li>All</li> : any
> : ^^^
>li : any
> : ^^^
>li : any
> : ^^^
{categories.map((category) => (
>categories.map((category) => ( <li key={category}>{category}</li> // Error about 'key' only )) : any[]
> : ^^^^^
>categories.map : <U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]
> : ^ ^^ ^^^ ^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^
>categories : string[]
> : ^^^^^^^^
>map : <U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]
> : ^ ^^ ^^^ ^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^
>(category) => ( <li key={category}>{category}</li> // Error about 'key' only ) : (category: string) => any
> : ^ ^^^^^^^^^^^^^^^^
>category : string
> : ^^^^^^
>( <li key={category}>{category}</li> // Error about 'key' only ) : any
> : ^^^
<li key={category}>{category}</li> // Error about 'key' only
><li key={category}>{category}</li> : any
> : ^^^
>li : any
> : ^^^
>key : string
> : ^^^^^^
>category : string
> : ^^^^^^
>category : string
> : ^^^^^^
>li : any
> : ^^^
))}
</ul>
>ul : any
> : ^^^
);
};