# Subtype for UnionAll

**URL:** <https://discourse.julialang.org/t/subtype-for-unionall/93896>\
**Category:** General Usage\
**Tags:** type\
**Created:** [February 1, 2023, 10:53pm UTC](https://discourse.julialang.org/t/subtype-for-unionall/93896 "2023-02-01T22:53:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![romatead](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@romatead](https://discourse.julialang.org/u/romatead)\
**Post date:** [February 1, 2023, 10:53pm UTC](https://discourse.julialang.org/t/subtype-for-unionall/93896/1 "2023-02-01T22:53:13Z")

</div>

Dear all,

I would like to define ab abstract type `T1{T}` as a UnionAll and to be a subtype of an abstract type `T0{T}`. How can I define a type with the `const` syntax as a subtype of an abstract type ? The following does not give the desired outcome :

```julia
const T1 = expr{T} where {T} <: T0{T}

```

I could also fo the other way and define `T0{T}` as a UnionAll and define `T1` as a subtype.

```julia
abstract type T1{T} <: T0{T} end

```

but Julia throws the `invalid subtyping in definition of T1` error.

How could I go about either defining a UnionAll as a subtype or defining a subtype of a UnionAll ?

Thanks !

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [February 2, 2023, 1:10am UTC](https://discourse.julialang.org/t/subtype-for-unionall/93896/2 "2023-02-02T01:10:10Z")

</div>

```julia
julia> abstract type T1{T} <: AbstractVector{T} end

julia> typeof(T1)
UnionAll

```

what’s not working?
