I am trying to define Union types that collect different instances of different types, it should be possible to append newer types that are defined later on, so that the union types can grow
here an example:
module Elements
CElems{C,M} = Union{} where {C,M}
Elems2D{C,M} = Union{} where {C,M}
Elems3D{C,M} = Union{} where {C,M}
struct quad{C,M} end
struct tria{C,M} end
struct hexa{C,M} end
struct tetra{C,M} end
Elems2D{C,M} = Union{CElems{C,M}, quad{C,M}} where {C,M}
Elems2D{C,M} = Union{CElems{C,M}, tria{C,M}} where {C,M}
Elems3D{C,M} = Union{CElems{C,M}, hexa{C,M}, tetra{C,M}} where {C,M}
CElems{C,M} = Union{Elems2D{C,M}, Elems3D{C,M}} where {C,M}
end
it gives me this error, on line 15 (Elems2D{C,M} = Union{CElems{C,M}, quad{C,M}} where {C,M}
)
ERROR: LoadError: TypeError: in Type{...} expression, expected UnionAll, got Type{Union{}}
things work if the types are not parametric, but I do need that
hope I have been clear about what I am trying to obtain