# Complicated type question

**URL:** <https://discourse.julialang.org/t/complicated-type-question/24582>\
**Category:** General Usage\
**Created:** [May 24, 2019, 6:42pm UTC](https://discourse.julialang.org/t/complicated-type-question/24582 "2019-05-24T18:42:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![atteson](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@atteson](https://discourse.julialang.org/u/atteson)\
**Post date:** [May 24, 2019, 6:42pm UTC](https://discourse.julialang.org/t/complicated-type-question/24582/1 "2019-05-24T18:42:55Z")

</div>

I’d like to define some types similar to the following simplified types. However, since T3’s type is determined by U, I’d rather not have to specify T when writing its type. Is there a way to do this?

```julia
abstract type T1{T}; end

mutable struct T2{T} <: T1{T}; x::T; end

mutable struct T3{T, U <: T1{T}} <: T1{T}; x::U; end

```

The motivation is that I need nested compositions of types such as `T3{T,T3{T,T2{T}}}` and don’t want to keep repeating T.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [May 25, 2019, 6:38am UTC](https://discourse.julialang.org/t/complicated-type-question/24582/2 "2019-05-25T06:38:20Z")

</div>

I am not sure I understand what you are trying to do.

In any case, I would advise against trying to express complex type relations in parameter restrictions. You can always have an inner constructor verify them.
