Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardTypeScriptvariance co contraSingle-choice MCQ

When the same `infer R` appears in two covariant (return) positions of a single conditional, how does the checker combine the candidates, and what is the result here?

type Ret<T> = T extends { a: () => infer R; b: () => infer R; } ? R : never; type X = Ret<{ a: () => string; b: () => number }>;