janet-lang / janet

A dynamic language and bytecode vm
https://janet-lang.org
MIT License
3.45k stars 223 forks source link

Fix order in which *macro-lints* is set during expansion #1185

Closed chris-chambers closed 1 year ago

chris-chambers commented 1 year ago

Previously, *macro-lints* was set after the macroexpand1 fiber was resumed, rather than just before. And, *macro-lints* was never cleared. This behavior was typically fine since the main users of compile pass the same lint array repeatedly, and the first macro expansion (somewhere in boot.janet) never produces a lint. But, when compiling with a fresh lint array, if the first macro invocation produced a lint, the lint was always lost.