Skip to content

Commit adcfa9a

Browse files
committed
Revert #14 for Julia 0.6
1 parent 1e290d0 commit adcfa9a

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

src/mono.jl

+5-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ function Monomial{C}(α) where C
2828
α == 1 || error("Cannot convert to a Monomial{$C} as it is not one")
2929
Monomial{C}(PolyVar{C}[], Int[])
3030
end
31-
# defaults to commutative so that `Monomial(1)` is consistent with TypedPolynomials
32-
Monomial(α) = Monomial{true}(α)
31+
32+
@static if VERSION v"0.7-"
33+
# defaults to commutative so that `Monomial(1)` is consistent with TypedPolynomials
34+
Monomial::Number) = Monomial{true}(α)
35+
end
3336

3437
Base.copy(m::M) where {M<:Monomial} = M(m.vars, copy(m.z))
3538

test/mono.jl

+9-7
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@
2727
@test one(Monomial{true}) == 1
2828
@test_throws ErrorException Monomial(2)
2929
@test (@inferred Monomial(1)) isa Monomial{true}
30-
@test Monomial(1) == 1
31-
@test_throws ErrorException Monomial{true}(2)
32-
@test (@inferred Monomial{true}(1)) isa Monomial{true}
33-
@test Monomial{true}(1) == 1
34-
@test_throws ErrorException Monomial{false}(2)
35-
@test (@inferred Monomial{false}(1)) isa Monomial{false}
36-
@test Monomial{false}(1) == 1
30+
if VERSION v"0.7-"
31+
@test Monomial(1) == 1
32+
@test_throws ErrorException Monomial{true}(2)
33+
@test (@inferred Monomial{true}(1)) isa Monomial{true}
34+
@test Monomial{true}(1) == 1
35+
@test_throws ErrorException Monomial{false}(2)
36+
@test (@inferred Monomial{false}(1)) isa Monomial{false}
37+
@test Monomial{false}(1) == 1
38+
end
3739
@polyvar x
3840
@test_throws ArgumentError Monomial{true}([x], [1,0])
3941
@test zeroterm(x^2) isa Term{true, Int}

0 commit comments

Comments
 (0)