You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found this because of the recent iterations of the interfaces-are-not-defined discussions. I saw a[1], which is suspicious, and asked "what is an AbstractRange ? I still don't know the answer. But, descending through subtypes, I find that one of them violates the assumption on the index of the first element. But, that looks like an ad hoc decision. It doesn't tell me who, strictly speaking, is in violation.
This is the method called.
Statistics.jl/src/Statistics.jl
Line 780 in e133202
It's not clear from
AbstractRange
whether the first index must be1
:AbstractRange{T} Supertype for ranges with elements of type T. UnitRange and other types are subtypes of this.
But,
Base.Slice
violates this assumption. Maybemiddle(a::AbstractRange) = middle(first(a), a[end])
is correct.The text was updated successfully, but these errors were encountered: