-
Notifications
You must be signed in to change notification settings - Fork 98
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
Type error with negative floats as static expressions #4054
Comments
Thanks for the good bugreport. There is some tension whether |
Regardless of that distinction, I think I'm confused about the difference between Float and Int, though. I'm pretty sure signs used to be treated uniformly. |
Ah, the not fully resolved question of whether our notion of “static” for modules means “is a (manifest) value” or “can be evaluated (purely) to a value”. But I guess we don't need to fully answer that, and just continue to find a pragmatic middle ground - we already allow projections, certain (soon more) negations, without claiming to be fully principled here. |
So the staticness checker regards any use of
Is there a reason to do that only for |
Okay, it seems that was a hack introduced in #505. Treating signs as part of literals is nasty. For one, there shouldn't be a difference between Second, it inevitably screws up operator precedence: for example, making |
Yeah, it’s a mess either way. But doing this to just |
Fix for issue #4054 Adopting the same hack we use for integral literals.
Moc version: 0.8.8
I get the following error when trying to declare a static value with a negative float in it:
type error [M0014], non-static expression in library or module
Is this intended?
I am trying to generate a large static piece of data but all the negative floats wont work
The text was updated successfully, but these errors were encountered: