Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/promote.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/promote.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}]
Expand Down