JSAbrahams / mamba

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

Function return is not super of body when body nullable #321

Closed JSAbrahams closed 2 years ago

JSAbrahams commented 2 years ago

How to Reproduce

    def some_higher_order(self, fun: Int -> Int) -> Int? => fun(10)
    def fancy(self) -> Int => self.some_higher_order(\x: Int => x * 2)

Expected behavior

The above should fail because body is nullable, whereas the function signature does say that the return type is integer.