# Need @inline for constructors?

**URL:** <https://discourse.julialang.org/t/need-inline-for-constructors/35442>\
**Category:** General Usage\
**Created:** [March 3, 2020, 7:12am UTC](https://discourse.julialang.org/t/need-inline-for-constructors/35442 "2020-03-03T07:12:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomtom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomtom/32/5106_2.png) [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Post date:** [March 3, 2020, 7:12am UTC](https://discourse.julialang.org/t/need-inline-for-constructors/35442/1 "2020-03-03T07:12:00Z")

</div>

as I saw in codes of various packages, `@inline` is not seen for inner constructor. So, is it **valid** at all to annotate `@inline` for inner constructors?  
what about outer constructors? thanks.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 3, 2020, 7:21am UTC](https://discourse.julialang.org/t/need-inline-for-constructors/35442/2 "2020-03-03T07:21:04Z")

</div>

What makes you think it is not valid? Eg

```julia
struct Foo
    @inline function Foo()
        @info "we are so inline"
        @assert 1 + 1 == 2 # just making sure
        new()
    end
end
    
@inline Foo(y) = Foo() # ignore variable to spite users

```

inlines just fine.

Generally you may not be seeing a lot of `@inline` these days because the compiler is getting eerrily good at figuring out these things so you don’t need to hint.

A lot of older code is peppered with `@inline` all over the place because no one bothered to remove it.
