diff --git a/src/promote.jl b/src/promote.jl index fe845060..d2cd49ce 100644 --- a/src/promote.jl +++ b/src/promote.jl @@ -26,7 +26,6 @@ end function promote_rule_constant(::Type{S}, PT::Type{<:APL{T}}) where {S, T} return polynomialtype(PT, promote_type(S, T)) end -Base.promote_rule(::Type{PT}, ::Type{T}) where {T, PT<:APL} = promote_rule_constant(T, PT) Base.promote_rule(::Type{T}, ::Type{PT}) where {T, PT<:APL} = promote_rule_constant(T, PT) # Resolve method ambiguity with Base: Base.promote_rule(::Type{Any}, ::Type{<:APL}) = Any diff --git a/test/promote.jl b/test/promote.jl index 34426c93..53b6a18f 100644 --- a/test/promote.jl +++ b/test/promote.jl @@ -23,6 +23,8 @@ @test Y[2] == 2x + 4y @test dot(X, [1 2; 3 4] * X) == x^2 + 5x*y + 4y^2 + @test typeof(promote_type(Any, typeof(MP.changecoefficienttype(x + 1, Any)))) == Any + function _t(a, b, T) if VERSION < v"1.6" @test typeof(@inferred vcat(a, b)) in [Vector{T}, Vector{Any}]