-
Notifications
You must be signed in to change notification settings - Fork 216
Closed
Labels
Milestone
Description
Our current approach to silencing only a subset of diagnostics in unreachable sections of code has some issues. They are documented here. In short, we still emit false positives in some cases:
if False:
x: int = 1
else:
x: str = "a"
if False:
# TODO We currently emit a false positive here:
# error: [invalid-assignment] "Object of type `Literal["a"]` is not assignable to `int`"
other: int = x
else:
other: str = xWe should re-evaluate if it makes more sense to silence all diagnostics (possibly with a very limited set of exceptions, like reveal_type-messages) in unreachable sections.
Reactions are currently unavailable