-
Notifications
You must be signed in to change notification settings - Fork 119
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
Setting array sizes from constants throws #11
Comments
This is a bit tricky, and what you really need is a macro pre-processor, which we don't have. |
C++ has constexpr. Perhaps LLJS could implement a similar mechanism? |
Sorry, it shouldn't have thrown. I was missing an error message. Trying to use a const (or any other expression) now at least prints a nice error. As far as implementing const sizes, yes, it might be possible, but at the moment the structure of the compiler and when array size calculation happens is not conducive to checking expressions to make sure they are really const literals (we don't have scoping or variable information at the point where size calculation happens). |
Defining an array size from a constant or variable throws a
messageFormat is undefined
error:Both declarations throws the error.
Arrays allocated on the heap are not affected though.
The text was updated successfully, but these errors were encountered: