tomhrr / dale

Lisp-flavoured C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compiler Abort: Unable to find symbol in LFC

ChengCat opened this issue · comments

(import macros)
(def f1 (fn intern void (void)))
(def f2 (fn intern void (void) (f1)))
(using-namespace std.macros
  (def m (macro intern (void)
    (nullptr DNode)))
  (def m2 (macro intern (void)
    (m)
    (nullptr DNode))))

With the above code, the compiler aborts with:

Unable to find symbol (_Z2f1) in LFC.

But if I move the defs around a bit, it compiles fine:

(import macros)
(def f1 (fn intern void (void)))
(using-namespace std.macros
  (def m (macro intern (void)
    (nullptr DNode)))
  (def m2 (macro intern (void)
    (m)
    (nullptr DNode))))
(def f2 (fn intern void (void) (f1)))

Thanks for this. There is a problem with how undefined symbol resolution is handled when a macro is called. A stopgap has been added for this case, so compilation of the first example will now succeed, but it still needs more work before this issue can be closed.