static:
type Obj = object
i: int
var o: Obj
o.i = 2
echo o.i
generates SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Is this a know problem or shall I sumbit a bug report?
Sorry, turned out that the fix in the pipeline doesn't fix this bug. However, the workaround is easy:
type Obj = object
i: int
proc p() {.compileTime.} =
var o: Obj
o.i = 2
echo o.i
static:
p()