alan icon indicating copy to clipboard operation
alan copied to clipboard

Potentially eliminate `void`?

Open dfellis opened this issue 4 years ago • 0 comments

It is currently required right now to declare a function does not return a value, but as an actual variable type it is wholly useless. Maybe<T> fills in for optional types and all variables are required to have a value assigned to them, so there's no "default to void" behavior. Therefore defining a variable as void and passing it around is useless.

If we made trying to assign the return type of a non-returning function a compiler error, we could turn void simply into an implementation detail instead of a variable type.

dfellis avatar Aug 19 '20 16:08 dfellis