Skip to content

Commit f92136f

Browse files
committed
add an extra test case
1 parent 668ccde commit f92136f

File tree

3 files changed

+653
-0
lines changed

3 files changed

+653
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,294 @@
1+
//// [tests/cases/conformance/types/typeRelationships/typeInference/intraExpressionInferencesNestedGenericCall1.ts] ////
2+
3+
=== intraExpressionInferencesNestedGenericCall1.ts ===
4+
interface FastifyTypeProvider {
5+
>FastifyTypeProvider : Symbol(FastifyTypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 0, 0))
6+
7+
readonly input: unknown;
8+
>input : Symbol(FastifyTypeProvider.input, Decl(intraExpressionInferencesNestedGenericCall1.ts, 0, 31))
9+
10+
readonly output: unknown;
11+
>output : Symbol(FastifyTypeProvider.output, Decl(intraExpressionInferencesNestedGenericCall1.ts, 1, 26))
12+
}
13+
14+
export interface FastifyTypeProviderDefault extends FastifyTypeProvider {}
15+
>FastifyTypeProviderDefault : Symbol(FastifyTypeProviderDefault, Decl(intraExpressionInferencesNestedGenericCall1.ts, 3, 1))
16+
>FastifyTypeProvider : Symbol(FastifyTypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 0, 0))
17+
18+
type CallTypeProvider<F extends FastifyTypeProvider, I> = (F & {
19+
>CallTypeProvider : Symbol(CallTypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 5, 74))
20+
>F : Symbol(F, Decl(intraExpressionInferencesNestedGenericCall1.ts, 7, 22))
21+
>FastifyTypeProvider : Symbol(FastifyTypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 0, 0))
22+
>I : Symbol(I, Decl(intraExpressionInferencesNestedGenericCall1.ts, 7, 52))
23+
>F : Symbol(F, Decl(intraExpressionInferencesNestedGenericCall1.ts, 7, 22))
24+
25+
input: I;
26+
>input : Symbol(input, Decl(intraExpressionInferencesNestedGenericCall1.ts, 7, 64))
27+
>I : Symbol(I, Decl(intraExpressionInferencesNestedGenericCall1.ts, 7, 52))
28+
29+
})["output"];
30+
type UndefinedToUnknown<T> = [T] extends [undefined] ? unknown : T;
31+
>UndefinedToUnknown : Symbol(UndefinedToUnknown, Decl(intraExpressionInferencesNestedGenericCall1.ts, 9, 13))
32+
>T : Symbol(T, Decl(intraExpressionInferencesNestedGenericCall1.ts, 10, 24))
33+
>T : Symbol(T, Decl(intraExpressionInferencesNestedGenericCall1.ts, 10, 24))
34+
>T : Symbol(T, Decl(intraExpressionInferencesNestedGenericCall1.ts, 10, 24))
35+
36+
interface RouteGenericInterface {
37+
>RouteGenericInterface : Symbol(RouteGenericInterface, Decl(intraExpressionInferencesNestedGenericCall1.ts, 10, 67))
38+
39+
Querystring?: unknown;
40+
>Querystring : Symbol(RouteGenericInterface.Querystring, Decl(intraExpressionInferencesNestedGenericCall1.ts, 12, 33))
41+
}
42+
43+
interface FastifySchema {
44+
>FastifySchema : Symbol(FastifySchema, Decl(intraExpressionInferencesNestedGenericCall1.ts, 14, 1))
45+
46+
querystring?: unknown;
47+
>querystring : Symbol(FastifySchema.querystring, Decl(intraExpressionInferencesNestedGenericCall1.ts, 16, 25))
48+
49+
headers?: unknown;
50+
>headers : Symbol(FastifySchema.headers, Decl(intraExpressionInferencesNestedGenericCall1.ts, 17, 24))
51+
}
52+
53+
interface FastifyRequestType<Querystring = unknown> {
54+
>FastifyRequestType : Symbol(FastifyRequestType, Decl(intraExpressionInferencesNestedGenericCall1.ts, 19, 1))
55+
>Querystring : Symbol(Querystring, Decl(intraExpressionInferencesNestedGenericCall1.ts, 21, 29))
56+
57+
query: Querystring;
58+
>query : Symbol(FastifyRequestType.query, Decl(intraExpressionInferencesNestedGenericCall1.ts, 21, 53))
59+
>Querystring : Symbol(Querystring, Decl(intraExpressionInferencesNestedGenericCall1.ts, 21, 29))
60+
}
61+
62+
type ResolveRequestQuerystring<
63+
>ResolveRequestQuerystring : Symbol(ResolveRequestQuerystring, Decl(intraExpressionInferencesNestedGenericCall1.ts, 23, 1))
64+
65+
TypeProvider extends FastifyTypeProvider,
66+
>TypeProvider : Symbol(TypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 25, 31))
67+
>FastifyTypeProvider : Symbol(FastifyTypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 0, 0))
68+
69+
SchemaCompiler extends FastifySchema,
70+
>SchemaCompiler : Symbol(SchemaCompiler, Decl(intraExpressionInferencesNestedGenericCall1.ts, 26, 43))
71+
>FastifySchema : Symbol(FastifySchema, Decl(intraExpressionInferencesNestedGenericCall1.ts, 14, 1))
72+
73+
> = UndefinedToUnknown<
74+
>UndefinedToUnknown : Symbol(UndefinedToUnknown, Decl(intraExpressionInferencesNestedGenericCall1.ts, 9, 13))
75+
76+
CallTypeProvider<TypeProvider, SchemaCompiler["querystring"]>
77+
>CallTypeProvider : Symbol(CallTypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 5, 74))
78+
>TypeProvider : Symbol(TypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 25, 31))
79+
>SchemaCompiler : Symbol(SchemaCompiler, Decl(intraExpressionInferencesNestedGenericCall1.ts, 26, 43))
80+
81+
>;
82+
83+
interface ResolveFastifyRequestType<
84+
>ResolveFastifyRequestType : Symbol(ResolveFastifyRequestType, Decl(intraExpressionInferencesNestedGenericCall1.ts, 30, 2))
85+
86+
TypeProvider extends FastifyTypeProvider,
87+
>TypeProvider : Symbol(TypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 32, 36))
88+
>FastifyTypeProvider : Symbol(FastifyTypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 0, 0))
89+
90+
SchemaCompiler extends FastifySchema,
91+
>SchemaCompiler : Symbol(SchemaCompiler, Decl(intraExpressionInferencesNestedGenericCall1.ts, 33, 43))
92+
>FastifySchema : Symbol(FastifySchema, Decl(intraExpressionInferencesNestedGenericCall1.ts, 14, 1))
93+
94+
> {
95+
query: ResolveRequestQuerystring<TypeProvider, SchemaCompiler>;
96+
>query : Symbol(ResolveFastifyRequestType.query, Decl(intraExpressionInferencesNestedGenericCall1.ts, 35, 3))
97+
>ResolveRequestQuerystring : Symbol(ResolveRequestQuerystring, Decl(intraExpressionInferencesNestedGenericCall1.ts, 23, 1))
98+
>TypeProvider : Symbol(TypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 32, 36))
99+
>SchemaCompiler : Symbol(SchemaCompiler, Decl(intraExpressionInferencesNestedGenericCall1.ts, 33, 43))
100+
}
101+
102+
interface FastifyRequest<
103+
>FastifyRequest : Symbol(FastifyRequest, Decl(intraExpressionInferencesNestedGenericCall1.ts, 37, 1))
104+
105+
RouteGeneric extends RouteGenericInterface = RouteGenericInterface,
106+
>RouteGeneric : Symbol(RouteGeneric, Decl(intraExpressionInferencesNestedGenericCall1.ts, 39, 25))
107+
>RouteGenericInterface : Symbol(RouteGenericInterface, Decl(intraExpressionInferencesNestedGenericCall1.ts, 10, 67))
108+
>RouteGenericInterface : Symbol(RouteGenericInterface, Decl(intraExpressionInferencesNestedGenericCall1.ts, 10, 67))
109+
110+
SchemaCompiler extends FastifySchema = FastifySchema,
111+
>SchemaCompiler : Symbol(SchemaCompiler, Decl(intraExpressionInferencesNestedGenericCall1.ts, 40, 69))
112+
>FastifySchema : Symbol(FastifySchema, Decl(intraExpressionInferencesNestedGenericCall1.ts, 14, 1))
113+
>FastifySchema : Symbol(FastifySchema, Decl(intraExpressionInferencesNestedGenericCall1.ts, 14, 1))
114+
115+
TypeProvider extends FastifyTypeProvider = FastifyTypeProviderDefault,
116+
>TypeProvider : Symbol(TypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 41, 55))
117+
>FastifyTypeProvider : Symbol(FastifyTypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 0, 0))
118+
>FastifyTypeProviderDefault : Symbol(FastifyTypeProviderDefault, Decl(intraExpressionInferencesNestedGenericCall1.ts, 3, 1))
119+
120+
RequestType extends FastifyRequestType = ResolveFastifyRequestType<
121+
>RequestType : Symbol(RequestType, Decl(intraExpressionInferencesNestedGenericCall1.ts, 42, 72))
122+
>FastifyRequestType : Symbol(FastifyRequestType, Decl(intraExpressionInferencesNestedGenericCall1.ts, 19, 1))
123+
>ResolveFastifyRequestType : Symbol(ResolveFastifyRequestType, Decl(intraExpressionInferencesNestedGenericCall1.ts, 30, 2))
124+
125+
TypeProvider,
126+
>TypeProvider : Symbol(TypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 41, 55))
127+
128+
SchemaCompiler
129+
>SchemaCompiler : Symbol(SchemaCompiler, Decl(intraExpressionInferencesNestedGenericCall1.ts, 40, 69))
130+
131+
>,
132+
> {
133+
query: RequestType["query"];
134+
>query : Symbol(FastifyRequest.query, Decl(intraExpressionInferencesNestedGenericCall1.ts, 47, 3))
135+
>RequestType : Symbol(RequestType, Decl(intraExpressionInferencesNestedGenericCall1.ts, 42, 72))
136+
}
137+
138+
interface RouteOptions<
139+
>RouteOptions : Symbol(RouteOptions, Decl(intraExpressionInferencesNestedGenericCall1.ts, 49, 1))
140+
141+
RouteGeneric extends RouteGenericInterface,
142+
>RouteGeneric : Symbol(RouteGeneric, Decl(intraExpressionInferencesNestedGenericCall1.ts, 51, 23))
143+
>RouteGenericInterface : Symbol(RouteGenericInterface, Decl(intraExpressionInferencesNestedGenericCall1.ts, 10, 67))
144+
145+
SchemaCompiler extends FastifySchema,
146+
>SchemaCompiler : Symbol(SchemaCompiler, Decl(intraExpressionInferencesNestedGenericCall1.ts, 52, 45))
147+
>FastifySchema : Symbol(FastifySchema, Decl(intraExpressionInferencesNestedGenericCall1.ts, 14, 1))
148+
149+
TypeProvider extends FastifyTypeProvider,
150+
>TypeProvider : Symbol(TypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 53, 39))
151+
>FastifyTypeProvider : Symbol(FastifyTypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 0, 0))
152+
153+
> {
154+
schema?: SchemaCompiler;
155+
>schema : Symbol(RouteOptions.schema, Decl(intraExpressionInferencesNestedGenericCall1.ts, 55, 3))
156+
>SchemaCompiler : Symbol(SchemaCompiler, Decl(intraExpressionInferencesNestedGenericCall1.ts, 52, 45))
157+
158+
onRequest?: (
159+
>onRequest : Symbol(RouteOptions.onRequest, Decl(intraExpressionInferencesNestedGenericCall1.ts, 56, 26))
160+
161+
request: FastifyRequest<RouteGeneric, SchemaCompiler, TypeProvider>,
162+
>request : Symbol(request, Decl(intraExpressionInferencesNestedGenericCall1.ts, 57, 15))
163+
>FastifyRequest : Symbol(FastifyRequest, Decl(intraExpressionInferencesNestedGenericCall1.ts, 37, 1))
164+
>RouteGeneric : Symbol(RouteGeneric, Decl(intraExpressionInferencesNestedGenericCall1.ts, 51, 23))
165+
>SchemaCompiler : Symbol(SchemaCompiler, Decl(intraExpressionInferencesNestedGenericCall1.ts, 52, 45))
166+
>TypeProvider : Symbol(TypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 53, 39))
167+
168+
) => void;
169+
method: "GET" | "POST";
170+
>method : Symbol(RouteOptions.method, Decl(intraExpressionInferencesNestedGenericCall1.ts, 59, 12))
171+
172+
url: string;
173+
>url : Symbol(RouteOptions.url, Decl(intraExpressionInferencesNestedGenericCall1.ts, 60, 25))
174+
175+
handler: (
176+
>handler : Symbol(RouteOptions.handler, Decl(intraExpressionInferencesNestedGenericCall1.ts, 61, 14))
177+
178+
request: FastifyRequest<RouteGeneric, SchemaCompiler, TypeProvider>,
179+
>request : Symbol(request, Decl(intraExpressionInferencesNestedGenericCall1.ts, 62, 12))
180+
>FastifyRequest : Symbol(FastifyRequest, Decl(intraExpressionInferencesNestedGenericCall1.ts, 37, 1))
181+
>RouteGeneric : Symbol(RouteGeneric, Decl(intraExpressionInferencesNestedGenericCall1.ts, 51, 23))
182+
>SchemaCompiler : Symbol(SchemaCompiler, Decl(intraExpressionInferencesNestedGenericCall1.ts, 52, 45))
183+
>TypeProvider : Symbol(TypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 53, 39))
184+
185+
) => void;
186+
}
187+
188+
interface FastifyInstance<TypeProvider extends FastifyTypeProvider> {
189+
>FastifyInstance : Symbol(FastifyInstance, Decl(intraExpressionInferencesNestedGenericCall1.ts, 65, 1))
190+
>TypeProvider : Symbol(TypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 67, 26))
191+
>FastifyTypeProvider : Symbol(FastifyTypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 0, 0))
192+
193+
route<
194+
>route : Symbol(FastifyInstance.route, Decl(intraExpressionInferencesNestedGenericCall1.ts, 67, 69))
195+
196+
RouteGeneric extends RouteGenericInterface,
197+
>RouteGeneric : Symbol(RouteGeneric, Decl(intraExpressionInferencesNestedGenericCall1.ts, 68, 8))
198+
>RouteGenericInterface : Symbol(RouteGenericInterface, Decl(intraExpressionInferencesNestedGenericCall1.ts, 10, 67))
199+
200+
SchemaCompiler extends FastifySchema,
201+
>SchemaCompiler : Symbol(SchemaCompiler, Decl(intraExpressionInferencesNestedGenericCall1.ts, 69, 47))
202+
>FastifySchema : Symbol(FastifySchema, Decl(intraExpressionInferencesNestedGenericCall1.ts, 14, 1))
203+
204+
>(
205+
opts: RouteOptions<RouteGeneric, SchemaCompiler, TypeProvider>,
206+
>opts : Symbol(opts, Decl(intraExpressionInferencesNestedGenericCall1.ts, 71, 4))
207+
>RouteOptions : Symbol(RouteOptions, Decl(intraExpressionInferencesNestedGenericCall1.ts, 49, 1))
208+
>RouteGeneric : Symbol(RouteGeneric, Decl(intraExpressionInferencesNestedGenericCall1.ts, 68, 8))
209+
>SchemaCompiler : Symbol(SchemaCompiler, Decl(intraExpressionInferencesNestedGenericCall1.ts, 69, 47))
210+
>TypeProvider : Symbol(TypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 67, 26))
211+
212+
): void;
213+
}
214+
215+
type Type<Output> = {
216+
>Type : Symbol(Type, Decl(intraExpressionInferencesNestedGenericCall1.ts, 74, 1))
217+
>Output : Symbol(Output, Decl(intraExpressionInferencesNestedGenericCall1.ts, 76, 10))
218+
219+
_output: Output;
220+
>_output : Symbol(_output, Decl(intraExpressionInferencesNestedGenericCall1.ts, 76, 21))
221+
>Output : Symbol(Output, Decl(intraExpressionInferencesNestedGenericCall1.ts, 76, 10))
222+
223+
};
224+
225+
declare function string(): Type<string>;
226+
>string : Symbol(string, Decl(intraExpressionInferencesNestedGenericCall1.ts, 78, 2))
227+
>Type : Symbol(Type, Decl(intraExpressionInferencesNestedGenericCall1.ts, 74, 1))
228+
229+
interface ZodTypeProvider extends FastifyTypeProvider {
230+
>ZodTypeProvider : Symbol(ZodTypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 80, 40))
231+
>FastifyTypeProvider : Symbol(FastifyTypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 0, 0))
232+
233+
output: this["input"] extends { _output: unknown }
234+
>output : Symbol(ZodTypeProvider.output, Decl(intraExpressionInferencesNestedGenericCall1.ts, 82, 55))
235+
>_output : Symbol(_output, Decl(intraExpressionInferencesNestedGenericCall1.ts, 83, 33))
236+
237+
? this["input"]["_output"]
238+
: never;
239+
}
240+
241+
const verifyAuth =
242+
>verifyAuth : Symbol(verifyAuth, Decl(intraExpressionInferencesNestedGenericCall1.ts, 88, 5))
243+
244+
<T extends FastifyRequest>() =>
245+
>T : Symbol(T, Decl(intraExpressionInferencesNestedGenericCall1.ts, 89, 3))
246+
>FastifyRequest : Symbol(FastifyRequest, Decl(intraExpressionInferencesNestedGenericCall1.ts, 37, 1))
247+
248+
(req: T) => {};
249+
>req : Symbol(req, Decl(intraExpressionInferencesNestedGenericCall1.ts, 90, 3))
250+
>T : Symbol(T, Decl(intraExpressionInferencesNestedGenericCall1.ts, 89, 3))
251+
252+
declare const server: FastifyInstance<ZodTypeProvider>;
253+
>server : Symbol(server, Decl(intraExpressionInferencesNestedGenericCall1.ts, 92, 13))
254+
>FastifyInstance : Symbol(FastifyInstance, Decl(intraExpressionInferencesNestedGenericCall1.ts, 65, 1))
255+
>ZodTypeProvider : Symbol(ZodTypeProvider, Decl(intraExpressionInferencesNestedGenericCall1.ts, 80, 40))
256+
257+
server.route({
258+
>server.route : Symbol(FastifyInstance.route, Decl(intraExpressionInferencesNestedGenericCall1.ts, 67, 69))
259+
>server : Symbol(server, Decl(intraExpressionInferencesNestedGenericCall1.ts, 92, 13))
260+
>route : Symbol(FastifyInstance.route, Decl(intraExpressionInferencesNestedGenericCall1.ts, 67, 69))
261+
262+
url: "/config",
263+
>url : Symbol(url, Decl(intraExpressionInferencesNestedGenericCall1.ts, 94, 14))
264+
265+
method: "GET",
266+
>method : Symbol(method, Decl(intraExpressionInferencesNestedGenericCall1.ts, 95, 17))
267+
268+
schema: {
269+
>schema : Symbol(schema, Decl(intraExpressionInferencesNestedGenericCall1.ts, 96, 16))
270+
271+
querystring: string(),
272+
>querystring : Symbol(querystring, Decl(intraExpressionInferencesNestedGenericCall1.ts, 97, 11))
273+
>string : Symbol(string, Decl(intraExpressionInferencesNestedGenericCall1.ts, 78, 2))
274+
275+
},
276+
onRequest: verifyAuth(),
277+
>onRequest : Symbol(onRequest, Decl(intraExpressionInferencesNestedGenericCall1.ts, 99, 4))
278+
>verifyAuth : Symbol(verifyAuth, Decl(intraExpressionInferencesNestedGenericCall1.ts, 88, 5))
279+
280+
handler: async (req) => {
281+
>handler : Symbol(handler, Decl(intraExpressionInferencesNestedGenericCall1.ts, 100, 26))
282+
>req : Symbol(req, Decl(intraExpressionInferencesNestedGenericCall1.ts, 101, 18))
283+
284+
const query: string = req.query;
285+
>query : Symbol(query, Decl(intraExpressionInferencesNestedGenericCall1.ts, 102, 9))
286+
>req.query : Symbol(FastifyRequest.query, Decl(intraExpressionInferencesNestedGenericCall1.ts, 47, 3))
287+
>req : Symbol(req, Decl(intraExpressionInferencesNestedGenericCall1.ts, 101, 18))
288+
>query : Symbol(FastifyRequest.query, Decl(intraExpressionInferencesNestedGenericCall1.ts, 47, 3))
289+
290+
},
291+
});
292+
293+
export {};
294+

0 commit comments

Comments
 (0)