-
Notifications
You must be signed in to change notification settings - Fork 304
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
call_statement: should only be able to call a function that yields void? #1413
Comments
#1412 is a somewhat related grammar change. |
Played with this in Naga, and I'm strongly in favor of this. 🚀 |
I propose adding a void constructor builtin function:
A call to the Also, add the rule that when a statement is a function calll, that function must have void return type. edited to add the new validation rule |
Let's not mix this into the |
It's not uncommon to have compilers warn about unused variables. |
Ok, we can add Btw, since #1413 (comment) was written I've remade the support for function calling in Naga, and now this proposal doesn't give us anything at all. We are now totally cool to support:
|
I filed #1499 for the void constructor idea. |
Discussed 2021-03-09 |
Hey @jdashg you marked this as resolved-needs spec. But reading the notes, I'm not clear there was consensus to make this an error. I don't know what the consensus is. |
I read the consensus as:
|
I think this is closed by #2138. |
This PR adds the `skipLibCheck` option into the `tsconfig.json` file and turns it on. Adding the flag takes a local full rebuild of the CTS using the dawn CTS runner from 14-16s down to 8-9s.
That can catch some programming errors.
If you really want to call a value-producing function at statement level, only for its side effects, then you can always capture its result in a const-declaration.
Or
The text was updated successfully, but these errors were encountered: