# Type inference with a tuple slice

**URL:** <https://discourse.julialang.org/t/type-inference-with-a-tuple-slice/33650>\
**Category:** General Usage\
**Tags:** type\
**Created:** [January 22, 2020, 2:53am UTC](https://discourse.julialang.org/t/type-inference-with-a-tuple-slice/33650 "2020-01-22T02:53:40Z")\
**Posts on this page:** 1\
**Showing post:** 7

<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:** [February 9, 2020, 4:52pm UTC](https://discourse.julialang.org/t/type-inference-with-a-tuple-slice/33650/7 "2020-02-09T16:52:58Z")

</div>

> [@Skoffer](#):
>
> more straightforward approach with [`@generated`](https://docs.julialang.org/en/v1/manual/metaprogramming/#Generated-functions-1) functions

Generally one would avoid generated functions whenever possible (and here it is possible). See

> [@Why not use @generated?](https://discourse.julialang.org/t/why-not-use-generated/29531/4):
>
> Generated functions are an escape hatch that allows you to bypass the regular multiple dispatch mechanism. As such, you should only use them if regular multiple dispatch can’t get you what we need. Since multiple dispatch is a very powerful abstraction, you should think carefully about whether your problem is of sufficient complexity that it is beyond the reach of regular multiple dispatch. If you use generated functions, the compiler will have less information about what the function is going t…

---

_[View the full topic](https://discourse.julialang.org/t/type-inference-with-a-tuple-slice/33650)._
