# Parametric type of another parametric type

**URL:** <https://discourse.julialang.org/t/parametric-type-of-another-parametric-type/69258>\
**Category:** General Usage\
**Tags:** parametric-types\
**Created:** [October 5, 2021, 9:17pm UTC](https://discourse.julialang.org/t/parametric-type-of-another-parametric-type/69258 "2021-10-05T21:17:34Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![ismedina](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ismedina/32/26433_2.png) [@ismedina](https://discourse.julialang.org/u/ismedina)\
**Post date:** [October 6, 2021, 2:22pm UTC](https://discourse.julialang.org/t/parametric-type-of-another-parametric-type/69258/8 "2021-10-06T14:22:17Z")

</div>

Small update, the following works (though the parametric type info seems redundant and a bit ugly):

```julia
mutable struct MultiScalePointCloud3{C<:AbstractPointCloud{D} where D, D} <: AbstractPointCloud{D}
    clouds::Vector{C}
    
    function MultiScalePointCloud3(clouds::Vector{<:AbstractPointCloud{D}}) where D
        new{eltype(clouds), D}(clouds)
    end        
end

```

Then running your example works:

```julia-repl
julia> pc1 = PointCloud(rand(2), rand(2, 2)); pc2 = PointCloud(rand(2), rand(2, 2)); 
julia> MultiScalePointCloud3([pc1, pc2])

MultiScalePointCloud3{PointCloud{2}, 2}(PointCloud{2}[PointCloud{2}([0.35587458766228375, 0.6051753465967098], [0.4138969988482093 0.6551431546310509; 0.14082576707455363 0.201651648972335]), PointCloud{2}([0.625358369477327, 0.44195778548245435], [0.016822896118342312 0.7482201544433038; 0.9469228843657014 0.09926806881414962])])

julia> typeof(PC)<:AbstractPointCloud{2}
true

```

---

_[View the full topic](https://discourse.julialang.org/t/parametric-type-of-another-parametric-type/69258)._
