-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
Description
(Opening as requested by @kayila after talking to her about it.)
While not restricting the return type is a reasonable default behavior for a scripting language, it would be nice to be able to opt-in to it when wanted.
I'm thinking something like this, where the -> int specifies the return type and is optional:
function factorial(int n) -> int {
if (n == 1) {
return 1;
}
return n * factorial(n - 1);
}
If no return type is specified, it'd probably make the most sense to not restrict it in any way.