Skip to content
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

Improve consistency and usability of void type and stmt/expr distinction #3

Open
1 of 3 tasks
kodek16 opened this issue May 15, 2020 · 0 comments
Open
1 of 3 tasks

Comments

@kodek16
Copy link
Owner

kodek16 commented May 15, 2020

(a.k.a. the void-sanity tracking issue)

The void type and statement vs. expression syntax right now is quite easy to trip on. Missing semicolon errors point to the next line which is most often unrelated to the issue. Both in the compiler internals and various documentation, void and void-expressions stick out as a sore thumb.

There are a number of things that need to be done to address it:

  • Make semicolons optional.
  • Automatically promote expressions to statements when and only when implied by context.
  • Consider removing void type from program IR. This would prevent a lot of confusion and potential void-related errors, but might require considerable code duplication (IfExpr/IfStmt, BlockExpr/BlockStmt, function calls, maybe something else?).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant