declare function makeRequest<
QueryParam
>(
getFn: (client: { prop: number }) => QueryParam,
params: NoInfer<QueryParam>,
): void;
// Hovering over `makeRequest` shows that `QueryParam` is inferred as `unknown` and `params` is obstensibly typed as `unknown` which is incongruous with this call is an error.
makeRequest(
(client) => client,
// Using autocomplete here suggests globals, not `prop` like it should.
{},
// ^ Argument of type '{}' is not assignable to parameter of type '{ prop: number; }'.
);
makeRequest(
(client: { prop: number }) => client,
// Using autocomplete here now suggests keys.
{},
);
Sub-part of microsoft/TypeScript#46916 (comment) with parts pointed out with microsoft/TypeScript#46916 (comment)
See @Andarist's analysis at microsoft/TypeScript#46916 (comment)
Sub-part of microsoft/TypeScript#46916 (comment) with parts pointed out with microsoft/TypeScript#46916 (comment)
See @Andarist's analysis at microsoft/TypeScript#46916 (comment)