JSAbrahams / mamba

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

Checker does not note if body was statement #343

Closed JSAbrahams closed 2 years ago

JSAbrahams commented 2 years ago

Description of Bug

The check stage is not able to detect if a function body never actually returns a value. It only checks that we return the correct type when we do.

How to Reproduce

def f(x: Int) -> Int => return print(x)

checks, as well as

def f(x: Int) -> Int => print(x)

Expected behavior

The above should fail because: