# Make an existing type a child of an abstract type

**URL:** <https://discourse.julialang.org/t/make-an-existing-type-a-child-of-an-abstract-type/28162>\
**Category:** General Usage\
**Tags:** traits\
**Created:** [August 29, 2019, 11:41am UTC](https://discourse.julialang.org/t/make-an-existing-type-a-child-of-an-abstract-type/28162 "2019-08-29T11:41:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Raf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raf/32/3383_2.png) [@Raf](https://discourse.julialang.org/u/Raf)\
**Post date:** [August 29, 2019, 12:11pm UTC](https://discourse.julialang.org/t/make-an-existing-type-a-child-of-an-abstract-type/28162/2 "2019-08-29T12:11:00Z")

</div>

No. But you can wrap it and type the wrapper.

Heres a toy example, `AbstractVector3D` should actualy be `<: AbstractArray{T,N}`:

```julia
abstract type Vector3D <: AbstracVector3D
    data::SVector{3}
end

Base.parent(a::Vector3D) = a.data

```

Then you can write out all the SVector methods you need manually like:

```julia
getindex(a::Vector3D, I...) = getindex(parent(a), I...)

```

Or use the `@forward` macro in Lazy.jl to do them all at once. I can’t recall exactly what you need here.

But first you should have a good reason why you need such specialized types.

---

_[View the full topic](https://discourse.julialang.org/t/make-an-existing-type-a-child-of-an-abstract-type/28162)._
