Commit 5f82c4d
committed
fix(query-core): restore NoInfer on persister's TQueryKey
Follow-up to #10510. That PR removed NoInfer from all three persister
generics to fix TQueryFnData inference when the companion queryFn
declares a parameter (#7842). Keeping NoInfer on TQueryKey preserves
that fix while preventing the persister slot from widening TQueryKey
inference.
Without NoInfer on TQueryKey, the persister slot contributes to
TQueryKey inference. When Register.queryKey is augmented to a narrowed
constraint, TQueryKey widens to that constraint instead of the literal
passed to queryKey. Wrappers that brand their return with
DataTag<TQueryKey, ...> then produce a brand on the wider type, which
a plain literal tuple can no longer satisfy in contravariant positions
(vi.mocked(...).mockReturnValue, typed variable assignments, etc.).
TQueryFnData still participates in inference, so #10510's positive and
negative type tests continue to pass.1 parent dd901ae commit 5f82c4d
2 files changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
| 249 | + | |
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| |||
0 commit comments