You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's not currently a way to enforce that code paths terminate in a use of ret or retVoid in a proc. It's not clear if there's a way to do this, but a good example of the problem is this:
test =proc"test"$ body $ (ifte_ false (ret true) (return()))
This will typecheck and generate code, though the generated C will include a path that would return no value, and generate a warning.
The text was updated successfully, but these errors were encountered:
The type-checking pass over the AST now catches this. The following warnings and errors are produced from compiling the above function:
*** procedure/area test WARNING: One branch of an if-then-else statement contains a return statement. Statements after the if-the-else block are not reachable on all control paths.
*** procedure/area test ERROR: No return statement and procedure has a non-void type.
*** Exception: There were type-checking errors.
There's not currently a way to enforce that code paths terminate in a use of
ret
orretVoid
in aproc
. It's not clear if there's a way to do this, but a good example of the problem is this:This will typecheck and generate code, though the generated C will include a path that would return no value, and generate a warning.
The text was updated successfully, but these errors were encountered: