JSAbrahams / mamba

🐍 The Mamba programming language, because we care about safety
MIT License
85 stars 3 forks source link

Check doesn't notice if fun returns `None` for non-nullable ret type #366

Closed JSAbrahams closed 1 year ago

JSAbrahams commented 1 year ago

Description of Bug

Type check does not catch if function returns None when it should return a non-nullable type. At the very least, it doesn't catch this if the None is nested in a ternary expression.

How to Reproduce

Run a check on: def f() -> Int => if True then 10 else None

Expected behavior

Should not check.