You are most likely trying to copy a "gradient number" into a vector that only takes Floats or something.
If you initialize your vector with zeros(10) or something, you should instead initialize it like zeros(eltype(x), 10) where x is your input vector.