Closed rebcabin closed 7 months ago
This https://github.com/lcompilers/lpython/pull/2501 would hopefully fix the constant step in loop issue.
There is also another issue in the above code.
VR_SIZE: i32 = 32_768
l: Const[i32] = VR_SIZE
VR_SIZE
is a variable (not a constant) for which the value will be assigned at run time. So, we cannot use VR_SIZE
as the constant/initialization value for l: Const[i32] = VR_SIZE
.
Currently, we can do either of the following ways to fix the above.
VR_SIZE
should also be a constant so that its value can be used to initialize another constant. For example:
VR_SIZE: Const[i32] = 32_768
l: Const[i32] = VR_SIZE
Or we can simply initialize l
with the constant value. For example:
VR_SIZE: i32 = 32_768
l: Const[i32] = 32_768
Thanks. Yes, I missed that last one.
Completed in https://github.com/lcompilers/lpython/pull/2501.