If you only need a few types, you probably want something like
struct Picture
lines :: Vector{Union{LineA,LineB}}
end
still that can come with performance problems, because if you define a method that acts on these types, and you dispatch on this vector at run time, the dynamic dispatch will have a performance penalty. If you have many types, probably you will need some of the ideas that were dicussed in these threads, because at the end they ended up in a discussion of exactly that problem: