No, the type of a value can never be mutated in Julia, so there’s no way to mutate an Array{Int} into an Array{Float64}. The easiest way around this is to just not pass an Array{Int} into your function.
If you want a convenient way to operate on Int array inputs, you could consider making both a mutating and non-mutating version of the function:
function rotate!(r)
r .= 1.5
end
function rotate(r)
out = similar(r, promote_type(eltype(r), Float64))
rotate!(out)
out
end
This is a common pattern in Julia, where the non-mutating function is just a convenient wrapper to allocate some output, call the mutating version on that output, and then return the result.
In this specific case, the mutating function is not written properly.
It allocates a number of temporary arrays, does the multiplication and writes the result back from a temporary array to the original. Whenever you have that pattern, it’s best to just return the temporary array instead of doing extra work of writing its contents into the original.