Aqua.jl
Aqua.jl copied to clipboard
`test_ambiguities` suggests invalid method types
I'm not sure if this is really an Aqua
issue - it might be a bug in Julia itself. I often get results like
Ambiguity #1
logdensity_def(s::S, β, x) where {A, B, S<:MeasureBase.SuperpositionMeasure{Tuple{A, B}}} in MeasureBase at /home/chad/git/MeasureBase.jl/src/combinators/superpose.jl:102
logdensity_def(s, β::S, x) where {A, B, S<:MeasureBase.SuperpositionMeasure{Tuple{A, B}}} in MeasureBase at /home/chad/git/MeasureBase.jl/src/combinators/superpose.jl:123
Possible fix, define
logdensity_def(::Union{S, S, S, S}, ::S, ::Any) where {A, A, B, S<:MeasureBase.SuperpositionMeasure{Tuple{A, B}}, B, B, S<:MeasureBase.SuperpositionMeasure{Tuple{B, B}}, B, S<:MeasureBase.SuperpositionMeasure{Tuple{B, B}}, S<:MeasureBase.SuperpositionMeasure{Tuple{B, B}}, B, S<:MeasureBase.SuperpositionMeasure{Tuple{A, B}}}
Union{S, S, S, S}
is just S
, but as I understand it's illegal to have repeated type parameters as in where {A, A, ...}
After some fiddling around I managed to construct a smaller example and backtraced it back into julia base. This now gets tracked in https://github.com/JuliaLang/julia/issues/50246.