Another example of weird code generating a weird result type Foo = ref object flag: bool var test = Foo() proc setFlag(flag: var bool) = test = Foo() flag = true setFlag(test.flag) assert(test.flag, "how could this happen?") Run
- Tips on how to avoid Nim pointer instability bugs? japplegame
- Tips on how to avoid Nim pointer instability bugs? JohnLuck
- Tips on how to avoid Nim pointer instability bugs? Araq
- Tips on how to avoid Nim pointer instability bugs? japplegame
- Tips on how to avoid Nim pointer instability bugs? juancarlospaco
- Tips on how to avoid Nim pointer instability bugs? jrfondren
- Tips on how to avoid Nim pointer instability bugs? japplegame
- Tips on how to avoid Nim pointer instability bugs? japplegame
- Tips on how to avoid Nim pointer instability bugs? sls1005
- Tips on how to avoid Nim pointer instability bugs? Araq
- Tips on how to avoid Nim pointer instability bugs? japplegame
- Tips on how to avoid Nim pointer instability bugs? exelotl
- Tips on how to avoid Nim pointer instability bugs? Hlaaftana
- Tips on how to avoid Nim pointer instability bugs? demotomohiro
- Tips on how to avoid Nim pointer instability bugs? adrianv