# Resolving UnionAlls with a single concrete instance in struct declarations

**URL:** <https://discourse.julialang.org/t/resolving-unionalls-with-a-single-concrete-instance-in-struct-declarations/136754>\
**Category:** Internals & Design\
**Created:** [April 17, 2026, 7:59pm UTC](https://discourse.julialang.org/t/resolving-unionalls-with-a-single-concrete-instance-in-struct-declarations/136754 "2026-04-17T19:59:36Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Post date:** [April 20, 2026, 8:25am UTC](https://discourse.julialang.org/t/resolving-unionalls-with-a-single-concrete-instance-in-struct-declarations/136754/5 "2026-04-20T08:25:55Z")

</div>

> [@brainandforce](#):
>
> Can there be a mechanism for the Julia compiler to resolve almost concrete types in struct declarations like `SMatrix{N,N,T}`, which only have a single concrete instance, to avoid the type instability and performance hit? Perhaps some sort of function

I once created and registered a package with this exact purpose, TypeCompletion.jl. Topic on Discourse:

- [[ANN] TypeCompletion.jl: exploit redundancy to complete UnionAll types](https://discourse.julialang.org/t/ann-typecompletion-jl-exploit-redundancy-to-complete-unionall-types/113987)

Disclaimer: I have not taken a look at that package for some time. It might not be well-maintained. It might not follow some best practice. The design might not be how I would do it if I were to do it today again.

If you are interested in maintaining/developing it, I can transfer or whatever.

---

_[View the full topic](https://discourse.julialang.org/t/resolving-unionalls-with-a-single-concrete-instance-in-struct-declarations/136754)._
