Skip to content

Error on top level return statement

The ChocoPy grammar does not allow for top level return statements while our parser does. But this causes an error when checking for types. By default, you will throw an error like "the None-type is not assignable to the bottom type" (because at top level, the return type is set to the bottom type). I think there should be a custom error for this, as the error above does not clearly state why this is happening. This PR adds a test case for this case, but with a very subjective error message. You may decide how or if you want to merge this error.

Merge request reports

Loading