Skip to content

Commit

Permalink
Merge pull request #77 from fieker/fix_ambig
Browse files Browse the repository at this point in the history
Fix ambiguity warnings
  • Loading branch information
wbhart authored Jul 26, 2016
2 parents 771efbb + 3cfbadc commit 725a64a
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Nemo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ include("arb/ArbTypes.jl")

include("pari/PariTypes.jl")

include("ambiguities.jl") # remove ambiguity warnings

include("Groups.jl")

###########################################################
Expand Down
101 changes: 101 additions & 0 deletions src/ambiguities.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Fix ambiguities on julia 0.4

*(a::ResElem{fmpz}, b::fmpz) = parent(a)(data(a) * b)

*(a::fmpz, b::ResElem{fmpz}) = b*a

+(a::ResElem{fmpz}, b::fmpz) = parent(a)(data(a) + b)

+(a::fmpz, b::ResElem{fmpz}) = b + a

-(a::ResElem{fmpz}, b::fmpz) = parent(a)(data(a) - b)

-(a::fmpz, b::ResElem{fmpz}) = parent(b)(a - data(b))

function ==(a::ResElem{fmpz}, b::fmpz)
z = base_ring(a)(b)
return data(a) == mod(z, modulus(a))
end

==(a::fmpz, b::ResElem{fmpz}) = b == a

#

*(::fmpz, ::PolyElem{fmpz}) = nothing

*(::PolyElem{fmpz}, ::fmpz) = nothing

+(::fmpz, ::PolyElem{fmpz}) = nothing

+(::PolyElem{fmpz}, ::fmpz) = nothing

-(::fmpz, ::PolyElem{fmpz}) = nothing

-(::PolyElem{fmpz}, ::fmpz) = nothing

==(::fmpz, ::PolyElem{fmpz}) = nothing

==(::PolyElem{fmpz}, ::fmpz) = nothing

divexact(::PolyElem{fmpz}, ::fmpz) = nothing

evaluate(::PolyElem{fmpz}, ::fmpz) = nothing

#

*(::fmpz, ::SeriesElem{fmpz}) = nothing

*(::SeriesElem{fmpz}, ::fmpz) = nothing

+(::fmpz, ::SeriesElem{fmpz}) = nothing

+(::SeriesElem{fmpz}, ::fmpz) = nothing

-(::fmpz, ::SeriesElem{fmpz}) = nothing

-(::SeriesElem{fmpz}, ::fmpz) = nothing

==(::fmpz, ::SeriesElem{fmpz}) = nothing

==(::SeriesElem{fmpz}, ::fmpz) = nothing

*(::fmpz, ::MatElem{fmpz}) = nothing

*(::MatElem{fmpz}, ::fmpz) = nothing

+(::fmpz, ::MatElem{fmpz}) = nothing

+(::MatElem{fmpz}, ::fmpz) = nothing

-(::fmpz, ::MatElem{fmpz}) = nothing

-(::MatElem{fmpz}, ::fmpz) = nothing

==(::MatElem{fmpz}, ::fmpz) = nothing

divexact(::MatElem{fmpz}, ::fmpz) = nothing

#

setindex_t!(a::nmod_mat, b::GenRes{fmpz}, i::Int, j::Int) = setindex_!(a, data(b), i, j)

*(::FracElem{fmpz}, ::fmpz) = nothing

*(::fmpz, ::FracElem{fmpz}) = nothing

+(::FracElem{fmpz}, ::fmpz) = nothing

+(::fmpz, ::FracElem{fmpz}) = nothing

-(::FracElem{fmpz}, ::fmpz) = nothing

-(::fmpz, ::FracElem{fmpz}) = nothing

==(::FracElem{fmpz}, ::fmpz) = nothing

==(::fmpz, ::FracElem{fmpz}) = nothing

divexact(::FracElem{fmpz}, ::fmpz) = nothing

divexact(::fmpz, ::FracElem{fmpz}) = nothing

4 changes: 4 additions & 0 deletions src/flint/fmpz_rel_series.jl
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ function *(x::Int, y::fmpz_rel_series)
return z
end

*(x::fmpz_rel_series, y::Int) = y * x

function *(x::fmpz, y::fmpz_rel_series)
z = parent(y)()
z.prec = y.prec
Expand All @@ -224,6 +226,8 @@ function *(x::fmpz, y::fmpz_rel_series)
return z
end

*(x::fmpz_rel_series, y::fmpz) = y * x

###############################################################################
#
# Shifting
Expand Down
2 changes: 1 addition & 1 deletion src/generic/RelSeries.jl
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ doc"""
*{T <: RingElem}(a::SeriesElem{T}, b::T)
> Return $a\times b$.
"""
*{T <: RingElem}(a::SeriesElem, b::T) = b*a
*{T <: RingElem}(a::SeriesElem{T}, b::T) = b*a

doc"""
*{T <: RingElem}(a::SeriesElem{T}, b::Integer)
Expand Down

0 comments on commit 725a64a

Please sign in to comment.