TypeScript/tests/cases/compiler/substituteReturnTypeSatisfiesConstraint.ts
Wesley Wigham 18cd79e179
Allow infer type variables to have constraints inferred (#32093)
* Allow `infer` type variables to have constraints infered and allow the breakdown of substitutes in simplifiable source inferences

* Still skip conditional inference when `extends infer Q` so such a pattern still acts as a constraint size breaker
2020-01-24 16:59:20 -08:00

5 lines
147 B
TypeScript

type M = { p: string };
type O = { m: () => M };
type X<T extends M> = T;
type FFG<T> = T extends O ? X<ReturnType<T['m']>> : never; // error!