# Get return type with given parameters

**URL:** <https://discourse.julialang.org/t/get-return-type-with-given-parameters/81986>\
**Category:** General Usage\
**Created:** [May 31, 2022, 12:59pm UTC](https://discourse.julialang.org/t/get-return-type-with-given-parameters/81986 "2022-05-31T12:59:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Impressium](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/impressium/32/19575_2.png) [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Post date:** [May 31, 2022, 12:59pm UTC](https://discourse.julialang.org/t/get-return-type-with-given-parameters/81986/1 "2022-05-31T12:59:06Z")

</div>

Hi all 🙂

Is there a function to compute the return type from given parameters/ parameter types?

Cheers

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [May 31, 2022, 1:05pm UTC](https://discourse.julialang.org/t/get-return-type-with-given-parameters/81986/2 "2022-05-31T13:05:41Z")

</div>

> [@Testing return types of functions](https://discourse.julialang.org/t/testing-return-types-of-functions/50049/2):
>
> If you mean testing as in unit testing, Test offers the @inferred macro. If you mean testing as in checking what the return type will be before running g, you can also do this, but not through any exported methods (so beware). You can use Base.\_return\_type and Base.return\_types julia\> Base.return\_types(+, (Int, Float64)) 1-element Array{Any,1}: Float64 julia\> Base.\_return\_type(+, (Int, Float64)) Float64 The return type is only as stable as your functions and inputs though: julia\> Base.retu…
