Description
I was doing some work in Base and compiling a bunch of times. Once, non-deterministically, these ambiguity warning showed up during make:
subarray2.jl
Warning: New definition
getindex could not show value of type Tuple at subarray2.jl:84
is ambiguous with:
getindex could not show value of type Tuple at subarray2.jl:83.
To fix, define
getindex could not show value of type Tuple
before the new definition.
I wasn't doing anything related to subarrays or to getindex, and I checked that the warning disappeared when forcing make to run again without actually changing anything. Actually, I tried to reproduce it without success for at least 20 times. So I don't know what's the value of reporting, perhaps it's just the result of corruption in some totally unrelated area, but maybe someone can use this as a hint and find the bug (I don't know if this is related to other ambiguity issues, but I haven't found anything about non-deterministic ones).
For completeness: the warning refers to the following two lines in subarray.jl:
getindex{T,N,P,IV}(V::SubArray{T,N,P,IV}, I::AbstractArray{Bool,N}) = copy(sub(V, find(I)))
getindex{T,N,P,IV}(V::SubArray{T,N,P,IV}, I::Union(Real, AbstractVector)...) = getindex(V, to_index(I)...)
It seems the warning is spurious, since these two definitions do not lead to any ambiguity, although it's not trivial to see that, and in fact I haven't managed to reproduce the warning at the REPL. Plus, the other getindex
definitions in subarray.jl (particularly this one) would also help disambiguate anyway.
I saw this while I was based on commit 3cc1752.