if you are using Foo for dispatch, you could do:
struct FooA
x
end
struct FooB
x
end
const Foo = Union{FooA,FooB}
that will make Foo impossible to extend, but available for dispatch
if you are using Foo for dispatch, you could do:
struct FooA
x
end
struct FooB
x
end
const Foo = Union{FooA,FooB}
that will make Foo impossible to extend, but available for dispatch