Closed
Description
Hi,
there appears to be an issue with macroexpanding-all
when expanding a nested macro containing a let
binding in a try-finally clause:
error occurred during inlining: unable to resolve symbol 'other/xxx' in this context
To reproduce
- create a macro in a separate namespace wih a
xxx
let binding referenced in atry-finally
clause
(ns other)
(defmacro xtry
[]
`(let [xxx 5]
(try
5
(finally
(inc xxx)))))
- In another namespace, create a macro that calls the above macro, and expands it using
macroexpand-all
(ns issue
(:require [basilisp.walk :refer [macroexpand-all]]
[other :refer [xtry]]))
(defmacro abc [] `(xtry))
(macroexpand-all `(abc))
- Run the namesapce in the REPL an error is thrown by
macroexpand-all
basilisp.user=> (load "/issue")
exception: <class 'basilisp.lang.compiler.exception.CompilerException'> from <class 'basilisp.lang.compiler.exception.CompilerException'>
phase: :inlining
message: error occurred during inlining: unable to resolve symbol 'other/xxx' in this context
form: (basilisp.core/inc other/xxx)
location: <Macroexpand>:NO_SOURCE_LINE
Thanks
(I noticed this while working in a similar case with a nested time
call,.The start
let binding in the time
macro triggering this issue should be an autogen symbol. I'll open an additional ticket for that)
Metadata
Metadata
Assignees
Labels
No labels