# How to make an abstract type as a super type of composite types

**URL:** <https://discourse.julialang.org/t/how-to-make-an-abstract-type-as-a-super-type-of-composite-types/27174>\
**Category:** New to Julia\
**Created:** [August 5, 2019, 11:17am UTC](https://discourse.julialang.org/t/how-to-make-an-abstract-type-as-a-super-type-of-composite-types/27174 "2019-08-05T11:17:47Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Post date:** [June 11, 2020, 11:49pm UTC](https://discourse.julialang.org/t/how-to-make-an-abstract-type-as-a-super-type-of-composite-types/27174/9 "2020-06-11T23:49:58Z")

</div>

> [@janrpeters](#):
>
> ```julia
> abstract type MyTypeB <: MyTypeA end
> abstract type MyTypeC <: MyTypeA end
> 
> ```

Did you mean to reverse the “inequalities” here:

```julia
abstract type MyTypeB >: MyTypeA end
abstract type MyTypeC >: MyTypeA end

```

In other words, are you trying to define a `struct` and “later” (in another module that may not be used in all calls to the `struct`) make it a subtype of something else? I don’t think this is possible.

My conjecture is that you are doing this so that dispatch can be written based on the abstract type? Then you should not use a type hierarchy but traits. [BinaryTraits.jl](https://discourse.julialang.org/t/ann-binarytraits-jl-a-new-traits-package/37475) is a nice implementation, but there are others.

---

_[View the full topic](https://discourse.julialang.org/t/how-to-make-an-abstract-type-as-a-super-type-of-composite-types/27174)._
