Skip to content

Commit

Permalink
Fix ambiguity
Browse files Browse the repository at this point in the history
  • Loading branch information
YingboMa committed Feb 8, 2023
1 parent 08dc15c commit 7753530
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/num.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,))]
Expand Down Expand Up @@ -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
end
5 changes: 5 additions & 0 deletions test/overloads.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7753530

Please sign in to comment.