Closed larpon closed 4 years ago
Updated array_bug_example.zip so it's compatible with 576618d
hehe was doing the same :-)
I have it to pass the issue BTW
Thanks to @nsauzede it's now working using:
for !isnil(edge) {
p := (edge.pos)[0] // Fix by calling like this
println(p.x)
edge = C.jcv_diagram_get_next_edge( edge )
}
I'll still regard it as an issue - the compiler should warn, auto fix or at least tell me what's wrong - or the syntax should be valid :slightly_smiling_face:
It also works if you use pos [2]pos
, that also needs to be fixed.
Fixed size arrays need lots of work.
This issue seems to be fixed in the latest V (0.1.29 99e607d at the time of writing), but I can't test the code above as gg
now uses Sokol and the glfw
module was removed.
I can confirm it's fixed.
I've included the updated code here (stripped from all the graphic stuff) - outputting the seemingly correct points. array_bug_example.zip
V version: 0.1.22 b4e8989 0.1.23 576618d
OS: Linux / Kubuntu 18.04
What did you do? I'm trying to get the attached array_bug_example.zip example to compile.
It tries to access a fixed size property on a "forwarded"
C
struct in a loop.What did you expect to see? I expected it to work and print the value stored in
.x
What did you see instead?