diff --git a/src/promote.jl b/src/promote.jl index 1302fff..8639900 100644 --- a/src/promote.jl +++ b/src/promote.jl @@ -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}) diff --git a/test/Project.toml b/test/Project.toml index 46cf9f3..0b8e8bd 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -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" diff --git a/test/promote.jl b/test/promote.jl index 743f205..b020efd 100644 --- a/test/promote.jl +++ b/test/promote.jl @@ -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 \ No newline at end of file diff --git a/test/test/Project.toml b/test/test/Project.toml new file mode 100644 index 0000000..81648c0 --- /dev/null +++ b/test/test/Project.toml @@ -0,0 +1 @@ +[deps]