# Nesting subtype in parameter of a subtype

**URL:** https://discourse.julialang.org/t/nesting-subtype-in-parameter-of-a-subtype/58842
**Category:** General Usage
**Tags:** question
**Created:** [April 8, 2021, 3:16pm UTC](https://discourse.julialang.org/t/nesting-subtype-in-parameter-of-a-subtype/58842 "2021-04-08T15:16:54Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![cadojo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cadojo/32/25328_2.png) [@cadojo](https://discourse.julialang.org/u/cadojo)
#### Post date: [April 8, 2021, 3:16pm UTC](https://discourse.julialang.org/t/nesting-subtype-in-parameter-of-a-subtype/58842/1 "2021-04-08T15:16:54Z")

</div>

I’m struggling to create the following structure. Say I have…

```julia
abstract type AbstractType{A,B,C} end

```

and…

```julia
abstract type AbstractSubType{A,B,C} <: AbstractType{A,B,C} end

```

I’d like to make…

```julia
struct ConcreteType{D, E<:AbstractSubType{A,B,C}} <: AbstractType{A,B,C}
  field::E
end

```

Doing so produces **`A undefined`**. I can’t seem to figure out how to specify `where {A,B,C}` to produce the desired behavior (or if this is illegal somehow). **Has anyone ran into this?**

---

<div class="post-metadata">

### Author: ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)
#### Post date: [April 9, 2021, 1:35pm UTC](https://discourse.julialang.org/t/nesting-subtype-in-parameter-of-a-subtype/58842/2 "2021-04-09T13:35:52Z")

</div>

> [@cadojo](#):
>
> ```julia
> struct ConcreteType{D, E<:AbstractSubType{A,B,C}} <: AbstractType{A,B,C}
> field::E
> end
> 
> ```

It may be related to [this](https://github.com/JuliaLang/julia/issues/39280), maybe? It seems like the struct definition does not have a good mechanism to indicate which nested Types should be Type parameters and which nested Types are just types that exist and should be used as they are.
