# Accessing an object's unparameterized type

**URL:** <https://discourse.julialang.org/t/accessing-an-objects-unparameterized-type/89128>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [October 23, 2022, 5:37am UTC](https://discourse.julialang.org/t/accessing-an-objects-unparameterized-type/89128 "2022-10-23T05:37:06Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [October 23, 2022, 11:20am UTC](https://discourse.julialang.org/t/accessing-an-objects-unparameterized-type/89128/5 "2022-10-23T11:20:20Z")

</div>

This has been discussed numerous times - search for [“strip type parameters”](https://discourse.julialang.org/search?q=strip%20type%20parameters).

This is the most relevant result:

> [@Stripping parameter from parametric types](https://discourse.julialang.org/t/stripping-parameter-from-parametric-types/8293):
>
> I have writing code that maniuplates containers of arrays of custom types with several parameters, e.g. SomeArrayType{T, G1, G2, N} \<: AbstractArray{T, N}, where the last parameter in SomeArrayType is always the array rank N. The arrays that can be in the container can differ in rank N but otherwise should be the same type, for example Vector{SomeArray{T, G1, G2}} which can also be written Vector{SomeArray{T, G1, G2, N} where N}. I’d like to create a function arraytype that strips the last (ra…

> [@uniment](#):
>
> I’d like to call its constructor while discarding its parameters, in order to call it with different parameters, e.g. `Test{3,4}()`.

There may not be such a constructor. This is not safe to do in general. Reflection can only work in limited cases here. The “canonical” solution is to have `similar` implemented on your type.

---

_[View the full topic](https://discourse.julialang.org/t/accessing-an-objects-unparameterized-type/89128)._
