Closed
Description
openedon Aug 27, 2017
On 0.6.0,
foo1(t::Type, x) = Nullable{t}(sin(x))
foo2(t::Type{T}, x) where T = Nullable{t}(sin(x))
@btime foo1(Float64, 2)
408.815 ns (2 allocations: 48 bytes) # same with @allocated
@btime foo2(Float64, 2)
17.359 ns (0 allocations: 0 bytes)
However, both functions are @inferred
correctly, and have the same @code_llvm
. Why does foo1
allocate?
Might be related to #19137
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment