Skip to content

Commit a8f2ed1

Browse files
authored
Fix for Julia v1.6 (#156)
* Fix for Julia v1.6 * Fix show test
1 parent bb42dcd commit a8f2ed1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/polynomial.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,5 +403,5 @@ function Base.round(p::AbstractPolynomialLike; args...)
403403
polynomial!(round.(terms(p); args...), SortedState())
404404
end
405405

406-
Base.ndims(::Type{<:AbstractPolynomialLike}) = 0
406+
Base.ndims(::Union{Type{<:AbstractPolynomialLike}, AbstractPolynomialLike}) = 0
407407
Base.broadcastable(p::AbstractPolynomialLike) = Ref(p)

test/show.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
@test sprint(show, (x*y^2 + x + 1 + y)) == "xy² + x + y + 1"
44
@test sprint(show, (x + 1 + y) / x^2) == "(x + y + 1) / (x²)"
55
@test sprint(show, (x - y - x + y) / (x^2 - x)) == "(0) / (x² - x)"
6-
@test sprint(show, CustomPoly(1 + x)) == "CustomPoly{$Int,$(typeof(1 + x))}(x + 1)"
6+
cp = CustomPoly(1 + x)
7+
@test sprint(show, cp) == "$(typeof(cp))(x + 1)"
78
# Test taken from TypedPolynomials
89
@test sprint(show, x) == "x"
910
@test sprint(show, x^0) == "1"

0 commit comments

Comments
 (0)