Inferred type symbol in conditional type should be visible-but-banned in falsy arm #22610
Labels
Declined
The issue was declined as something which matches the TypeScript vision
Suggestion
An idea for TypeScript
Currently if you write
We give you an error because
U
is not in scope at all in the false arm.This is a) confusing (
U
is right there!) and b) a landmine, because you might have an outer type of the same nameWe should keep
U
in scope in both cases and disallow its use with an explicit error message, e.g. (please bikeshed):This should not block nesting of lexical scopes; i.e. this should still be legal because each
U
would shadow the outer expression's:The text was updated successfully, but these errors were encountered: