You might try the suggestion from the error message:
consider calling collect
→
a = reshape(collect(1:w*h), w, h)