fn main() {
m := { "1":"1", "2":"2" }
if b := m["1"] {.
defer { println(b)}
println("ok")
}
}
Result:
ufm@ufmpc:~/src/vtest$ ./vt
ok
ufm@ufmpc:~/src/vtest$ ./vt
ok
ufm@ufmpc:~/src/vtest$ ./vt
ok
ufm@ufmpc:~/src/vtest$ ./vt
ok
ufm@ufmpc:~/src/vtest$ ./vt
ok
0x774c4afa07cd: at ???: RUNTIME ERROR: invalid memory access
0x01f69500: by ???
Segmentation fault (core dumped)
Expected Behavior
Get the value of "b" or get a compiler error saying that this is not allowed.
Current Behavior
0x7178a25a07cd: at ???: RUNTIME ERROR: invalid memory access
0x02892500: by ???
Segmentation fault (core dumped)
Possible Solution
No response
Additional Information/Context
No response
V version
0.4.8 e1b842a
Environment details (OS name and version, etc.)
Linux
[!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.
Describe the bug
RUNTIME ERROR: invalid memory access
Reproduction Steps
Result:
Expected Behavior
Get the value of "b" or get a compiler error saying that this is not allowed.
Current Behavior
0x7178a25a07cd: at ???: RUNTIME ERROR: invalid memory access 0x02892500: by ??? Segmentation fault (core dumped)
Possible Solution
No response
Additional Information/Context
No response
V version
0.4.8 e1b842a
Environment details (OS name and version, etc.)
Linux
Huly®: INTEG-249