I was asked what was the current status of the differences between,
magic(obj::Any) = zero(typeof(obj))
and
magic(obj::T) where T = zero(T)
I believe in 0.6 there were some issues being worked out with performance degradation using where T, but I am not aware of the current status. I usually use :: and leave T when it is absolutely necessary.
Semantically they are the same. However AFAIU if obj::Function then there is a heuristic, that ::Any will only specialized if obj is called in the body of magic. The where version will specialize anyway.
julia> foo(x::Any) = 1
foo (generic function with 1 method)
julia> foo(x::T) where {T} = 2
foo (generic function with 1 method) # <- overwrites the old definition
julia> foo(x::T) where {T<:Integer} = 2
foo (generic function with 2 methods) # <- makes a new method