Skip to content

Method ambiguities of Float128 constructor suggested by Aqua.jl #61

@frankwswang

Description

@frankwswang

I was using Aqua.jl to do a quality test of Quadmath.jl, and I found the following method ambiguities:

julia> using Quadmath

julia> using Aqua

julia> Aqua.test_all(Quadmath)
Skipping Base.active_repl
Skipping Base.active_repl_backend
Skipping Base.Filesystem.JL_O_NOCTTY
Skipping Base.Filesystem.JL_O_SHORT_LIVED
3 ambiguities found
Ambiguity #1
Quadmath.Float128(data) in Quadmath at PathToPackages\Quadmath\Laqi7\src\Quadmath.jl:84
(::Type{T})(x::Base.TwicePrecision) where T<:Number in Base at twiceprecision.jl:266

Possible fix, define
  Quadmath.Float128(::Base.TwicePrecision)

Ambiguity #2
Quadmath.Float128(data) in Quadmath at PathToPackages\Quadmath\Laqi7\src\Quadmath.jl:84
(::Type{T})(z::Complex) where T<:Real in Base at complex.jl:44

Possible fix, define
  Quadmath.Float128(::Complex)

Ambiguity #3
Quadmath.Float128(data) in Quadmath at PathToPackages\Quadmath\Laqi7\src\Quadmath.jl:84
(::Type{T})(x::AbstractChar) where T<:Union{AbstractChar, Number} in Base at char.jl:50

Possible fix, define
  Quadmath.Float128(::AbstractChar)

Ambiguity 2 seems trivial to fix by defining a method that returns InexactError. However, we may need some special handling for ambiguities 1 and 3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions