Skip to content

Non-deterministic spurious ambiguity warning during make (in subarrays2.jl) #9588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
carlobaldassi opened this issue Jan 3, 2015 · 3 comments

Comments

@carlobaldassi
Copy link
Member

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.

@JeffBezanson
Copy link
Member

I only plan to work on this via #8974, which already lists 11 ambiguity-related issues. But you might be right that this indicates corruption elsewhere while loading that file, so that should maybe be investigated.

@timholy
Copy link
Member

timholy commented Jan 4, 2015

I've seen this quite a number of times, but you're right that it's rare. I've had the same experience with non-deterministic warnings on loading the Images.jl package (JuliaImages/Images.jl#59).

@timholy
Copy link
Member

timholy commented May 8, 2016

Given that subarray2 doesn't exist anymore, and the changes in #16125 and #16220, let's close this.

@timholy timholy closed this as completed May 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants