Check return statement presence #122

Open
opened 2025-07-07 12:34:40 +02:00 by belka · 1 comment
Owner

Allowing only one return statement at the end of a procedure has a nice property that it is easy to check that the procedure returns. The return statement in procedures without a return type (or noreturn) is checked and an error is reported, but another way around is ignored: a procedure that declares a return type, but doesn't return, compiles without an error.

Allowing only one return statement at the end of a procedure has a nice property that it is easy to check that the procedure returns. The return statement in procedures without a return type (or `noreturn`) is checked and an error is reported, but another way around is ignored: a procedure that declares a return type, but doesn't return, compiles without an error.
belka added the
bootstrap
label 2025-07-07 12:34:40 +02:00
Author
Owner
proc f() -> Int;
end;
``` proc f() -> Int; end; ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: belka/elna#122
No description provided.