Open ufm opened 3 weeks ago
Removed the typo of dot in the example:
if b := m["1"] {.
-> if b := m["1"] {
It is a problem, that will get solved when defer becomes scoped.
Currently defer will defer the execution till the function end, at which point b
is no longer well defined.
I believe the language authors know best how to address this issue, but there are essentially three options:
I like the third option the most. But it's up to the authors to decide.
Yes, option 3 is the one that will be implemented. We already have a plan for our defer
construct to be scoped by default, instead of the current behavior.
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