Closed
Description
TypeScript Version: 2.7.0-dev.201xxxxx
Code
type Cond<TIn> = TIn extends (infer A extends infer TInside ? infer C : infer D) ? [A, C, D] : never;
// more motivating real example:
type InvertCond<TIn> = TIn extends (infer T extends infer U ? infer A : infer B) ? (T extends U ? B : A) : TIn;
Expected behavior:
At least infer types A
, C
, and D
should be visible within the true
branch of the outer conditional type. Arguably, so should TInside
, depending on how you expect scoping to work.
Actual behavior:
Cannot find name "A"
Cannot find name "C"
Cannot find name "D"