The correct signature is
function foo(::Type{T}) where {T}
Otherwise, you will not get method specialization, and you’ll just get a generic method foo(::DataType)
The correct signature is
function foo(::Type{T}) where {T}
Otherwise, you will not get method specialization, and you’ll just get a generic method foo(::DataType)