Looks like what you found was a bug in ARC :)
[https://github.com/nim-lang/Nim/commit/8705ee7015382ac2957733dfef5e02a0831e7fb4](https://github.com/nim-lang/Nim/commit/8705ee7015382ac2957733dfef5e02a0831e7fb4)
@leorize \- when I use the variable first to calculate the other thing and
_then_ move it, there is no segfault. If I don't move at all there is also no
segfault.
If you do an explicit move, the variable will be cleared, so it can be reused.
The segfault is an indicator of a different problem.
type Example* = object
str: string
code: int
proc x0(s: string): int = s.len
proc x1(b: bool): Example =
var x = "abc"
if b:
return Example(str: move x, code: x0(x))
else:
return Example(str: "...")
echo x1(true)
echo