Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 7 additions & 0 deletions src/promote.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ function promote_rule_constant(
return term_type(TT, promote_type(S, T))
end

function promote_rule_constant(
::Type{Any},
TT::Type{<:AbstractTermLike{T}},
) where {T}
return Any
end

# PolynomialLike
Base.promote_rule(::Type{PT}, ::Type{PT}) where {PT<:_APL} = PT
function Base.promote_rule(PS::Type{<:_APL}, PT::Type{<:_APL})
Expand Down
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TypedPolynomials = "afbbf031-7a57-5f58-a1b9-b774a0fad08d"

[compat]
DynamicPolynomials = "0.5"
DynamicPolynomials = "0.5, 0.6.2"
TypedPolynomials = "0.4"
6 changes: 6 additions & 0 deletions test/promote.jl
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,9 @@ end
__promote_prod(PXY, PXY, PXY)
end
end

@testset "promote_operation with Any" begin
Mod.@polyvar x
V = typeof(x)
@test promote_type(V, Any) == Any
end
1 change: 1 addition & 0 deletions test/test/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[deps]
Loading