You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What did you do? ./v -g -o vdbg cmd/v && ./vdbg main.v && D:\vbug2\main.exe
modulemain
@[heap]
interfaceIGameObject {
mut:
name string
parent ?&IGameObject
next ?&IGameObject
child ?&IGameObject
last_child ?&IGameObject
}
@[heap]
structGameObject implements IGameObject {
mut:
name string
parent ?&IGameObject
next ?&IGameObject
child ?&IGameObject
last_child ?&IGameObject
}
fnmain() {
mutv1:=&GameObject{
name: 'v1'
}
mutnext:= v1.next
for {
if next !=none {
eprintln(next.name)
next= next.next
} else {
break
}
}
}
What did you see?
main.v:32:4: error: `next` is immutable, declare it with `mut` to make it mutable
30 | if next != none {
31 | eprintln(next.name)
32 | next = next.next
| ~~~~
33 | } else {
34 | break
What did you expect to see?
no v error
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.
V version: V 0.4.10 880f216, press to see full `v doctor` output
What did you do?
./v -g -o vdbg cmd/v && ./vdbg main.v && D:\vbug2\main.exeWhat did you see?
What did you expect to see?
no v error
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.