You are not using it in the function signature, that is for sure. That should work:
julia> foo(s::A, n::N=2) where {A<:Union{String,Vector{String}}, N <: Number} = s
foo (generic function with 2 methods)
julia> foo("test")
"test"
Thus, the problem is somewhere else. It is better if you post a snippet of code in which the error can be reproduced (in a fresh Julia section).
ps. Use the </> icon to write code within backticks, it becomes properly formatted.