Bug with global variable initializer
ChengCat opened this issue · comments
ChengCat commented
(def X (struct extern ((a (p void)))))
(def make-x (fn extern X (void)
(def tmp (var auto X))
tmp))
(def var-x (var extern X (make-x)))
With the above program, the compiler complains about:
error: unable to resolve pointer address in struct declaration
ChengCat commented
Sorry, this is actually a sound behaviour. The program compiles fine if changed to:
(def X (struct extern ((a (p void)))))
(def make-x (fn extern X (void)
(def tmp (var auto X))
(setf (: tmp a) (nullptr void))
tmp))
(def var-x (var extern X (make-x)))