You need to pass an instance (or, example) of a type, so in this case any real number would work like so
function do_something_3(x::Int, y::T) where {T<:Real}
intermediate_thing = Array{T}(undef,(3,4))
intermediate_thing[1,1] = 3.0
return(intermediate_thing[1,1] * x)
end
julia> do_something_3(1, 1.2)
3.0
Also, note you’re making another mistake when you write do_something(1.2, Float16). The argument x in do_something(x, y) needs to be an integer and not a float. For example, this fails (notice the stacktrace)
julia> do_something_3(1.0, 1.2)
ERROR: MethodError: no method matching do_something_3(::Float64, ::Float64)
Closest candidates are:
do_something_3(::Int64, ::T) where T<:Real at REPL[293]:1
but this doesn’t
julia> do_something_3(1, 1.2)
3.0