The signature should be defined as: foo(x::Vector{T}) where {T} instead.
Notice you are indeed able to get the type of the Vector from T as well as from eltype(x), ie.:
julia> function foo(x::Vector{T}) where {T}
@show(T, T == eltype(x))
return nothing
end
foo (generic function with 1 method)
julia> a = rand(5);
julia> b = rand(Int, 5);
julia> foo(a)
T = Float64
T == eltype(x) = true
julia> foo(b)
T = Int64
T == eltype(x) = true