There are a couple things happening here. First is that 1:5 is not an Array despite being an AbstractArray. An AbstractArray is anything that can be indexed into, and has a size (and is <:AbstractArray). An Array is a specific implementation. Ranges for example only store 3 numbers, the start, step, and stop of the range and computes indexing lazily. Similarly a view of an AbstractArray is still an AbstractArray, but also is not an Array.
The reason MyStruct(view(randn(10),1:5)) works is because the struct knows what type the field A has to be, and so will convert the input to match that type. This is unambiguous since there is only 1 type of MyStruct. Function dispatch, however never converts it’s arguments, and only uses types to determine which methods are applicable and most specific. As such, if you wanted to type this function, the best type for it would probably be something like
function f(A::AbstractVector{<:Number})