eltype_wrong(::Type{A}) where {A<:AbstractArray} = A.parameters[1]
the .parameters, though I can guess what it is, it’s an undocumented “field” of type parameters. I wonder if there’s any other hidden fields? a small section about these “fields” in doc would be fine. thanks.
Those fields are implementation details, and the purpose of that example (note the name eltype_wrong) is to demonstrate that one should not be using that sort of introspection, exactly because you cannot rely on the field even existing:
One common mistake is to try and get the element-type by using introspection:
eltype_wrong(::Type{A}) where {A<:AbstractArray} = A.parameters[1]
However, it is not hard to construct cases where this will fail:
struct BitVector <: AbstractArray{Bool, 1}; end
Here we have created a type BitVector which has no parameters, but where the element-type is still fully specified, with T equal to Bool !