Why am I getting the error message below? (I'm fairly new to metaprogramming in Julia.) Thanks.
julia> d = :e
:e
julia> macroexpand(:(b.$d))
:(b.e)
julia> macroexpand(:($d.c))
:(e.c)
julia> macroexpand(:(b.$d.c))
ERROR: unsupported or misplaced expression $
julia> macroexpand(:(b.$(d).c))
ERROR: unsupported or misplaced expression $
This was a bug, issue filed here:
https://github.com/JuliaLang/julia/issues/10997
It has been fixed since. As indicated in the comments on the question, there are some hacky workarounds if you're stuck on an unfixed Julia version, but hopefully you can upgrade.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With