Nemocas / AbstractAlgebra.jl

Generic abstract algebra functionality in pure Julia (no C dependencies)
https://nemocas.github.io/AbstractAlgebra.jl/dev/index.html
Other
158 stars 60 forks source link

Type piracy in AbstractAlgebra #1387

Open fingolfin opened 1 year ago

fingolfin commented 1 year ago

Enabling the type piracy report in test/Aqua.jl currently reports this (in Julia 1.10.3):

julia> using Aqua, AbstractAlgebra ; Aqua.test_piracies(AbstractAlgebra);
Possible type-piracy detected:
[1] gcd(a::T, b::T) where T<:AbstractFloat @ AbstractAlgebra ~/Projekte/OSCAR/AbstractAlgebra.jl/src/julia/Float.jl:107
[2] parent(a::T) where T<:AbstractFloat @ AbstractAlgebra ~/Projekte/OSCAR/AbstractAlgebra.jl/src/julia/Float.jl:17
[3] parent(a::T) where T<:Integer @ AbstractAlgebra ~/Projekte/OSCAR/AbstractAlgebra.jl/src/julia/Integer.jl:17
[4] parent(a::Rational{T}) where T<:Integer @ AbstractAlgebra ~/Projekte/OSCAR/AbstractAlgebra.jl/src/julia/Rational.jl:17
[5] sqrt(a::AbstractFloat; check) @ AbstractAlgebra ~/Projekte/OSCAR/AbstractAlgebra.jl/src/julia/Float.jl:135
[6] kwcall(::NamedTuple, ::typeof(sqrt), a::AbstractFloat) @ AbstractAlgebra ~/Projekte/OSCAR/AbstractAlgebra.jl/src/julia/Float.jl:135
thofma commented 1 year ago

Yes, these are base functions and base types. What do you suggest we do?

fieker commented 1 year ago

From Oscars point of view: we can remove them. From AA, there is nothing we can do...