Invalid redefinition error for parametric type defined inside macro call

Look at the result of macroexpand. You likely need to escape the input expression.

julia> macro passthru(ex)
           esc(ex)
       end

julia> @passthru type MyType{T}
           args::Vector{T}
       end

julia> @passthru type MyType{T}
           args::Vector{T}
       end
2 Likes