-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
C compilation bug #23356
Comments
At least there is a C error problem here because struct Colour{}
//const x = 800*1000*3
const x = 2_400_000
type ImageBuffer = [x]Colour But if we uncomment the
|
The problem (with the current compiler) is that the size of a fixed array must be known at compile time. Calculating Values such as those shown above are reduced at compile time, but not until the TRANSFORM step, which is long after the compile time evaluation has been done. So this particular issue brings up 2 things:
|
Or used for example to set the values of an enum const x = 1*2
const y = 1*2
enum Num {
x = x
y = y
}
println('${Num.x:d} ${Num.y:d}') // prints 2 2 |
V doctor:
What did you do?
./v -g -o vdbg cmd/v && ./vdbg main.v && main
What did you see?
What did you expect to see?
No errors
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
Huly®: V_0.6-21787
The text was updated successfully, but these errors were encountered: