JSAbrahams / mamba

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

Check that a statement correctly mentiones that it raises an exception #150

Closed JSAbrahams closed 4 years ago

JSAbrahams commented 5 years ago

Current Issue

148 and to a lesser extent #149

High-level description of the feature

In the language, any statement that may raise an exception must explicitly state so: <statement or expression> raises [<Errors>]

Description of potential implementation

Check that said expression or statement indeed does raise a said exception by looking at the signature of said function.

We also may have to look at the signatures of built-in functions, i.e. division can also throw an arithmetic error: ZeroDivisionError. It would however also need to apply type sensitive flow here, i.e. if we beyond a doubt know that the denominator cannot be 0 we know for sure that this error will not be raised.

JSAbrahams commented 4 years ago

I believe this has been implemented, but more tests should be added to be sure.