Skip to content

Commit

Permalink
macro hygiene: don't assume StructIO is in scope in io macro (#29)
Browse files Browse the repository at this point in the history
* macro hygiene: don't assume StructIO is in scope in io macro

* Update StructIO.jl: import from io macro

* Update StructIO.jl: interpolate StructIO
  • Loading branch information
stevengj authored Aug 9, 2024
1 parent 3f3cb2c commit 7651ffa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/StructIO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ macro io(typ, annotations...)

ret = Expr(:toplevel, :(Base.@__doc__ $(typ)))
strat = (alignment == :align_default ? StructIO.Default : StructIO.Packed)
push!(ret.args, :(StructIO.packing_strategy(::Type{T}) where {T <: $T} = $strat))
push!(ret.args, :($StructIO.packing_strategy(::Type{T}) where {T <: $T} = $strat))
return esc(ret)
end

Expand Down

0 comments on commit 7651ffa

Please sign in to comment.