**Bug Report** Not catching reference before assignment. **To Reproduce** The following code results in `UnboundLocalError: local variable 'result' referenced before assignment` if run, but mypy does not report an issue. ```py def foo(input: bool): if input: result = "value" print('result set') else: print('result is not assigned') return result a = foo(False) ``` **Expected Behavior** I would expect mypy to complain about `result` being referenced before assignment. **Actual Behavior** > `Success: no issues found in 1 source file` **Your Environment** - Mypy version used: 0.980+dev.61a9b92297e1363b5bd99855df51e9a84be8da69 (current master) - Mypy command-line flags: (none) - Mypy configuration options from `mypy.ini` (and other config files): none - Python version used: 3.10.5 and 3.9.7 (both with pyenv) - Operating system and version: Ubuntu 20.04.4 LTS **Notes** This is my firt bug report to mypy, so I'm sorry if this issue is already reported (I was not able to find it), or if this is out of scope for mypy. I do also realize that this is halting-problem-esque, but I believe this category of problem should be possible to resolve with static analysis.