julia> function permutations(v::Vector{T}) where T <: Any
nbase= length(v)
results= Vector{Vector{T}}(0)
for it=0:(nbase^nbase-1)
push!( results, v[digits( it; base=nbase, pad=nbase ) .+ 1] )
end#for
results
end#function##
Under 0.7, I got the helpful warnings, that led me to write a function that no longer works under 1.0 (and that readers should now ignore, given the solution):
What is the helpful warning you’ve got? Can you paste and follow that exactly? Your “fix” appears to be wrong. (It should be a warning about the constructor while you changed the type signature in a strange way).
I’m amused that it didn’t error but the reason your “fix” seems to work is that you didn’t actually removed the previous method, you are still calling the method with the depwarn which isn’t printing it anymore after the first call.
I assume you realized that Array{T, 1} is Vector{T} so it’s asking you to change the call to the method Vector{T}(m::Int) where T to Vector{T}(undef, m) instead.
The first one is a method signature, the second is the call syntax, that’s why the where T is not there. It has nothng to do with removing where T from the code.
I think what yuyichao and the error message means is that in your original function, results= Vector{Vector{T}}(0) should be results = Vector{Vector{T}}(undef, 0).