Motivation:

Imagine I want to use the return type of a function to define an output array of that type.

```
julia> makearray(f::Function, ::Type{T}) where T =
Core.Inference.return_type(f, (T,T))[]
makearray (generic function with 3 methods)
julia> makearray(cmp, Int)
0-element Array{Int64,1}
julia> makearray(cmp, Integer)
0-element Array{Any,1}
julia> which(cmp, (Integer, Integer))
cmp(x::Integer, y::Integer) in Base at operators.jl:348
julia> which(cmp, (Int, Int))
cmp(x::Integer, y::Integer) in Base at operators.jl:348
```

The result is as I expected with `Int`

, but fails with `Integer`

. That is due to `Core..return_type`

.

The used method is the same in both cases:

```
operators.jl:348
# cmp returns -1, 0, +1 indicating ordering
cmp(x::Integer, y::Integer) = ifelse(isless(x, y), -1, ifelse(isless(y, x), 1, 0))
```