# Why doesn't \`@nospecialize\` work in this example?

**URL:** <https://discourse.julialang.org/t/why-doesnt-nospecialize-work-in-this-example/88695>\
**Category:** General Usage\
**Created:** [October 13, 2022, 10:24pm UTC](https://discourse.julialang.org/t/why-doesnt-nospecialize-work-in-this-example/88695 "2022-10-13T22:24:31Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Zach\_Christensen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zach_christensen/32/7220_2.png) [@Zach\_Christensen](https://discourse.julialang.org/u/Zach_Christensen)\
**Post date:** [October 17, 2022, 6:07pm UTC](https://discourse.julialang.org/t/why-doesnt-nospecialize-work-in-this-example/88695/7 "2022-10-17T18:07:11Z")

</div>

Hmm, even `@noinline Base.@constprop :none has_trait(@nospecialize x) = true` ends up creating new methods.

Is all this expected behavior or should I file an issue?

Should `Base.inferencebarrier` be documented?

---

_[View the full topic](https://discourse.julialang.org/t/why-doesnt-nospecialize-work-in-this-example/88695)._
