From 7753530a229b9ed93746a11d7e26c1e835af7225 Mon Sep 17 00:00:00 2001 From: Yingbo Ma Date: Wed, 8 Feb 2023 09:21:01 -0500 Subject: [PATCH] Fix ambiguity --- src/num.jl | 4 ++-- test/overloads.jl | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/num.jl b/src/num.jl index bd54aa5a8..70d803566 100644 --- a/src/num.jl +++ b/src/num.jl @@ -140,7 +140,7 @@ end # Boolean operations for (f, Domain) in [:(==) => :((AbstractFloat, Number)), :(!=) => :((AbstractFloat, Number)), :(<=) => :((Real,)), :(>=) => :((Real,)), - :(isless) => :((Real,)), + :(isless) => :((Real, AbstractFloat)), :(<) => :((Real,)), :(> ) => :((Real,)), :(& )=> :((Bool,)), :(| ) => :((Bool,)), :xor => :((Bool,))] @@ -184,4 +184,4 @@ function Base.Docs.getdoc(x::Num) push!(strings, string(string(key), ": ", string(val))) end Markdown.parse(join(strings, "\n\n ")) -end \ No newline at end of file +end diff --git a/test/overloads.jl b/test/overloads.jl index fff2a9c1c..c728679c7 100644 --- a/test/overloads.jl +++ b/test/overloads.jl @@ -230,3 +230,8 @@ d = Base.Docs.getdoc(x) stringcontent = string(d.content) @test occursin("Metadata", stringcontent) @test occursin("(:variables, :x)", stringcontent) + +@variables t +for f in [<, <=, >, >=, isless] + @test_nowarn f(t, 1.0) +end