# No method matching error when calling generic constructor with concrete implementer of abstract type

**URL:** <https://discourse.julialang.org/t/no-method-matching-error-when-calling-generic-constructor-with-concrete-implementer-of-abstract-type/53192>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [January 12, 2021, 10:56am UTC](https://discourse.julialang.org/t/no-method-matching-error-when-calling-generic-constructor-with-concrete-implementer-of-abstract-type/53192 "2021-01-12T10:56:32Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![alice](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alice/32/20895_2.png) [@alice](https://discourse.julialang.org/u/alice)\
**Post date:** [January 12, 2021, 2:10pm UTC](https://discourse.julialang.org/t/no-method-matching-error-when-calling-generic-constructor-with-concrete-implementer-of-abstract-type/53192/9 "2021-01-12T14:10:30Z")

</div>

Ah, interesting. In the spirit of [this question](https://discourse.julialang.org/t/meaning-and-error-message-of-type-parameters/53198), it doesn’t seem like you even need to keep the `sptype` value around at all? Just make the struct be parameterized and don’t include any fields that mention the type.

As for Java, my most familiar language is Rust, and Rust even supports that pattern you mentioned, although you wouldn’t keep the type object around like I suggested. I just didn’t know enough Julia to know how to do that. In fact, you’ll find me on the Rust discourse, answering questions like you are doing here.

---

_[View the full topic](https://discourse.julialang.org/t/no-method-matching-error-when-calling-generic-constructor-with-concrete-implementer-of-abstract-type/53192)._
