JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
45.79k stars 5.49k forks source link

method of `convexhull` listed twice in candidates list when precompiled #33166

Open JeffBezanson opened 5 years ago

JeffBezanson commented 5 years ago

On 1.3:

julia> using Polyhedra
[ Info: Recompiling stale cache file /home/jeff/.julia/compiled/v1.3/Polyhedra/17i4E.ji for Polyhedra [67491407-f73d-577b-9b50-8179a7c68029]

julia> convexhull([1],[1],[1],[1])
ERROR: MethodError: convexhull(::Array{Int64,1}, ::Array{Int64,1}, ::Array{Int64,1}, ::Array{Int64,1}) is ambiguous. Candidates:
  convexhull(ps::AbstractArray{T,1} where T...) in Polyhedra at /home/jeff/.julia/packages/Polyhedra/JBt1B/src/repop.jl:67
  convexhull(p1::Union{AbstractArray{T,1}, Polyhedron{T}, VRepresentation{T}, Union{Line{T,AT}, Ray{T,AT}} where AT}, p2::Union{AbstractArray{T,1}, Polyhedron{T}, VRepresentation{T}, Union{Line{T,AT}, Ray{T,AT}} where AT}, ps::Union{AbstractArray{T,1}, Polyhedron{T}, VRepresentation{T}, Union{Line{T,AT}, Ray{T,AT}} where AT}...) where T in Polyhedra at /home/jeff/.julia/packages/Polyhedra/JBt1B/src/repop.jl:74
  convexhull(ps::AbstractArray{T,1} where T...) in Polyhedra at /home/jeff/.julia/packages/Polyhedra/JBt1B/src/repop.jl:67
Possible fix, define
  convexhull(::Vararg{AbstractArray{T,1} where T,N} where N)

I'm not aware of any other problem this causes, but it's suspicious that it only happens in precompiled mode, so I'm filing this in case it reflects a deeper issue.

First noticed https://github.com/JuliaLang/julia/pull/32973#issuecomment-527607487

timholy commented 3 years ago

For me on 1.8, this now happens even if I (1) add Polyhendra@0.5.5 (the release prior to https://github.com/JuliaPolyhedra/Polyhedra.jl/pull/188) and (2) delete the cache files for Polyhedra and then start Julia with --compiled-modules=no. Consequently, I think we can close this?