Skip to content

Commit 5b80e48

Browse files
authored
Fix typo in isambiguous (#48312)
* Fix typo in `isambiguous` * add test
1 parent 1b9f640 commit 5b80e48

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

base/reflection.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1858,7 +1858,7 @@ function isambiguous(m1::Method, m2::Method; ambiguous_bottom::Bool=false)
18581858
m = match.method
18591859
m === minmax && continue
18601860
if !morespecific(minmax.sig, m.sig)
1861-
if match.full_covers || !morespecific(m.sig, minmax.sig)
1861+
if match.fully_covers || !morespecific(m.sig, minmax.sig)
18621862
return true
18631863
end
18641864
end

test/ambiguous.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,18 @@ ambig(x::Int8, y) = 1
153153
ambig(x::Integer, y) = 2
154154
ambig(x, y::Int) = 3
155155
end
156-
157156
ambs = detect_ambiguities(Ambig5)
158157
@test length(ambs) == 2
159158

159+
module Ambig48312
160+
ambig(::Integer, ::Int) = 1
161+
ambig(::Int, ::Integer) = 2
162+
ambig(::Signed, ::Int) = 3
163+
ambig(::Int, ::Signed) = 4
164+
end
165+
ambs = detect_ambiguities(Ambig48312)
166+
@test length(ambs) == 4
167+
160168
# Test that Core and Base are free of ambiguities
161169
# not using isempty so this prints more information when it fails
162170
@testset "detect_ambiguities" begin

0 commit comments

Comments
 (0)