JSAbrahams / mamba

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

Always return value or exit function in handle arms #101

Closed JSAbrahams closed 2 years ago

JSAbrahams commented 5 years ago

Current Issue

We sometimes return optionals in a handle statement, meaning we still have to match afterwards. This makes them rather verbose, as we just move the problem (instead of dealing with errors we have to deal with an optional)

Description of the feature

Either always:

This means that if we assign to a value, it is no longer an optional, as we are guaranteed to either get a value or exit the function.

Description of potential solution

This must be checked in the type checker.

JSAbrahams commented 2 years ago

Not necessarily behavior we want