-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow void functions #13
Comments
Here is the error report such that we can derive a test case: This code has problems compiling: ns some_ns;
use sf addition (produce, consume);
fn main() {
let result = produce();
consume(result)
} It throws this error message:
The formatted version of the expression looks as follows:
According to this expression, the code actually looks as follows: ns some_ns;
use sf addition (produce, consume);
fn main() {
consume(produce());
} In any case, the lowering pass seems to expect a |
What you are talking about is ohua-dev/alang-clike-parser#7 which is already fixed. I will make a new release for ohuac soon which will include this fix. What I mean by fn foo (a) {
compute(a);
flush();
} Which I would like to desugar to let foo = \a -> let _ = compute a in let _ = flush () in () |
(I was not sure whether it was already taken care of, so I added it to this issue.) Sounds good to me. |
@JustusAdam is still a valid work item? I know that I fixed this in core at least. |
I think so. |
It has become apparent that it is necessary to support functions with no return. Perhaps we can abuse the
unit
hack again.The text was updated successfully, but these errors were encountered: