Roger-luo / Configurations.jl

Options & Configurations made easy.
https://configurations.rogerluo.dev/stable
MIT License
80 stars 12 forks source link

type alias does not work on parametric types #54

Open Roger-luo opened 3 years ago

Roger-luo commented 3 years ago

e.g

@option "aaa" struct OptionA{T}
   a::T
end

@option "bbb" struct OptionB{T}
   b::T
end

@option struct OptionC
   c::Union{OptionA, OptionB}
end

will result in not concrete type error when parsing back, due to the lack of information to determine T in type alias.

Roger-luo commented 2 years ago

One way to support this is to ask user to overload type_alias for different parametric type. And maybe overload another for parsing it back. Should check StructTypes.jl for this