# Julia inner type-inference working

**URL:** <https://discourse.julialang.org/t/julia-inner-type-inference-working/65521>\
**Category:** Performance\
**Tags:** question\
**Created:** [July 29, 2021, 8:12pm UTC](https://discourse.julialang.org/t/julia-inner-type-inference-working/65521 "2021-07-29T20:12:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![schlichtanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/schlichtanders/32/32145_2.png) [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Post date:** [July 29, 2021, 8:12pm UTC](https://discourse.julialang.org/t/julia-inner-type-inference-working/65521/1 "2021-07-29T20:12:59Z")

</div>

Hi all,

I run over a very surprising type-inference difference. I always thought these two codes would be regarded identical to Julia’s compiler.

```julia
make_sigtype_without_bits(::Type{T}) where T<:Tuple = Tuple{_make_sigtype_without_bits.(tuple(T.parameters...))...}
make_sigtype_without_bits2(sigtype) = Tuple{_make_sigtype_without_bits.(tuple(sigtype.parameters...))...}
_make_sigtype_without_bits(element::Type) = element
_make_sigtype_without_bits(bits) = Core.Typeof(bits)

```

however the difference is huge:

```julia
julia> Base.promote_op(make_sigtype_without_bits, Type{Tuple{Int, 1}})
Type{Tuple{Int64, Int64}}

julia> Base.promote_op(make_sigtype_without_bits2, Type{Tuple{Int, 1}})
Type

```

Does someone know why I need to use explicit `where` syntax in order to get the compiler support? What is the semantic difference between the versions explicit-where and no-where-at-all which make for such drastic differences?

Using Julia 1.6.1

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [July 29, 2021, 8:14pm UTC](https://discourse.julialang.org/t/julia-inner-type-inference-working/65521/2 "2021-07-29T20:14:20Z")

</div>

[https://docs.julialang.org/en/v1/manual/performance-tips/#Be-aware-of-when-Julia-avoids-specializing](https://docs.julialang.org/en/v1/manual/performance-tips/#Be-aware-of-when-Julia-avoids-specializing)

this is documented and explained here.

---

<div class="post-metadata">

**Author:** ![schlichtanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/schlichtanders/32/32145_2.png) [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Post date:** [July 29, 2021, 8:17pm UTC](https://discourse.julialang.org/t/julia-inner-type-inference-working/65521/3 "2021-07-29T20:17:59Z")

</div>

Impressive. I once read over the whole documentation. Either it is too long ago and I forgot or too long and documentation have been added meanwhile.

Really nice that this is already well documented and thank you so much for the fast and direct response!
