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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DynamicPolynomials"
uuid = "7c1d4256-1411-5781-91ec-d7bc3513ac07"
repo = "https://github.com/JuliaAlgebra/DynamicPolynomials.jl.git"
version = "0.6.1"
version = "0.6.2"

[deps]
Future = "9fa8497b-333b-5362-9e8d-4d0656e87820"
Expand Down
24 changes: 24 additions & 0 deletions src/promote.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
function MP.promote_rule_constant(
::Type{Any},
::Type{<:DMonomialLike{V,M}},
) where {V,M}
return Any
end
function MP.promote_rule_constant(
::Type{Any},
::Type{_Term{V,M,T}},
) where {V,M,T}
return Any
end
function MP.promote_rule_constant(
::Type{Any},
::Type{_Term{V,M,T}},
) where {V,M,T}
return Any
end
function MP.promote_rule_constant(
::Type{Any},
::Type{<:TermPoly{V,M,T}},
) where {V,M,T}
return Any
end
function MP.promote_rule_constant(
::Type{T},
::Type{<:DMonomialLike{V,M}},
Expand Down
7 changes: 7 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,11 @@ import DynamicPolynomials
end
end

@testset "Issue #166: promote_operation with Any" begin
DynamicPolynomials.@polyvar x
V = typeof(x)
@test promote_type(V, Any) == Any
@test promote_type(typeof(x/2), Any) == Any
end

include("mvp.jl")