beacon-biosignals / Legolas.jl

Tables.jl-friendly mechanisms for constructing, reading, writing, and validating Arrow tables against extensible, versioned, user-specified schemas.
Other
24 stars 2 forks source link

Incorrect escaping in `@version` macro? #91

Closed ericphanson closed 1 year ago

ericphanson commented 1 year ago
julia> using Legolas: @schema, @version

julia> @schema "a.b" A

julia> @version AV1 begin
        a::Int
        end
ERROR: UndefVarError: `Legolas` not defined
Stacktrace:
 [1] top-level scope
   @ ~/.julia/packages/Legolas/4phbF/src/schemas.jl:467
 [2] eval
   @ ./boot.jl:370 [inlined]
 [3] eval(x::Expr)
   @ Base.MainInclude ./client.jl:480
 [4] top-level scope
   @ ~/.julia/packages/Legolas/4phbF/src/schemas.jl:825
 [5] top-level scope
   @ ~/.julia/juliaup/julia-1.9.1+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/REPL/src/REPL.jl:1416

It looks like @version is counting on Legolas being in the caller's scope, when probably it should be referring to the Legolas name in the macro's module.