Structs defined with different fields based on concrete parameters?

Is it possible to define two different structs with the same name but different concrete parameters? I have a single type that changes and I want the rest of my code to react to that, including how other types are structured (and thus how they process the first type).

Example:

const A = ... # alias to some built-in data structure
const B = ... # alias to some built-in data structure

struct MyType{A}
    a
    b
end

struct MyType{B}
    a
    b
    c
end

No. Julias’ type system is nominal, which means that one name is one type - you cannot have two types with the same name in the same namespace. The canonical way to achieve this is to have one type, with the optional field being typed something like Union{Nothing T}, and subsequently checking which case you are in.

Ah, thanks for the explanation.