Roger-luo / Configurations.jl

Options & Configurations made easy.

Home Page:https://configurations.rogerluo.dev/stable

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

type alias does not work on parametric types

Roger-luo opened this issue · comments

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.

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