Closed
Description
Feature
Emit error if local var is undefined, example code that currently fails at runtime but passes type check:
def get_lines_to_render() -> list[str] | tuple[list[str], int]:
return []
lines = get_lines_to_render()
if isinstance(lines, tuple):
lines, cursor_pos = lines
else:
cursor_pos
cursor_pos = len(lines)
Pitch
Would be nice if I wouldn't have to run the code only to find out I had a typo. That's what type checking is all about....