oxc
oxc copied to clipboard
fix(semantic): enter scope after `check_type` for `TSConditionalType`
When visiting a TSConditionalType
, enter a new scope after visiting the check_type
, and exit before entering the false_type
.
Fixes this case, where B
should have a reference. I can't find the issue that was reported with this, if someone finds it please link it to this PR.
type S<A> = A extends /* enter scope */ (infer B extends number ? string : never)
? B
: /* exit scope before false branch */ false;
Ideally we'd update ast_tools
to let us configure the order of enter/leave scopes. CC: @overlookmotel.