# Why is it impossible to subtype a struct?

**URL:** https://discourse.julialang.org/t/why-is-it-impossible-to-subtype-a-struct/19876
**Category:** General Usage
**Created:** [January 21, 2019, 2:56pm UTC](https://discourse.julialang.org/t/why-is-it-impossible-to-subtype-a-struct/19876 "2019-01-21T14:56:38Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [January 21, 2019, 3:39pm UTC](https://discourse.julialang.org/t/why-is-it-impossible-to-subtype-a-struct/19876/3 "2019-01-21T15:39:56Z")

</div>

Multiple inheritance is a totally different story and could be allowed. I’ve written about why we don’t allow subtyping of concrete types before if someone wants to dig up one of my earlier posts about it.

Edit: here’s a link to an old google groups conversation about it

[https://groups.google.com/d/msg/julia-dev/eA4VkFAD-yQ/LNUP\_OT0zy0J](https://groups.google.com/d/msg/julia-dev/eA4VkFAD-yQ/LNUP_OT0zy0J)

In particular, this paragraph from the end of my first post on the thread sums up my position fairly well still:

> While there are a number of practical reasons to disallow subtyping of concrete types, I think they all stem from the basic fact that subtyping a concrete type is logically unsound. A type can only be instantiated if it is _completely_ specified, and it only makes sense to subtype something if it is _incompletely_ specified. Thus, a type should either be abstract or concrete but not both. What object-oriented languages that allow the same type to be both instantiated and subtyped are really doing is using the same name for two different things: a concrete type that can be instantiated and an abstract type that can be subtyped. Problems ensue since there’s no way to express which you mean. You end up with attempts to resolve this confusion like the “final” keyword and recommendations against ever subtyping classes that weren’t intended to be abstract. But wouldn’t it be better not to conflate the two things in the first place?

---

_[View the full topic](https://discourse.julialang.org/t/why-is-it-impossible-to-subtype-a-struct/19876)._
