Skip to content

Commit

Permalink
Exlcude now exludes kwsorter as well
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Sep 28, 2023
1 parent 299cb35 commit 8d1c919
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
15 changes: 5 additions & 10 deletions src/ambiguities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,11 @@ end
struct _NoValue end

function getobj(m::Method)
ty = try
fieldtype(m.sig, 1)
catch err
@error(
"Failed to obtain a function from `Method`.",
exception = (err, catch_backtrace())
)
# If this doesn't work, `Base` internal was probably changed
# too much compared to what it is now. So, bailing out.
return _NoValue()
signature = Base.unwrap_unionall(m.sig)
ty = if is_kwcall(signature)
signature.parameters[3]
else
signature.parameters[1]
end
ty = Base.unwrap_unionall(ty)
if ty <: Function
Expand Down
8 changes: 3 additions & 5 deletions test/test_ambiguities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ include("preamble.jl")
check_testcase([PkgWithAmbiguities.f], total - num_ambs_f)

# exclude function and kwsorter
check_testcase([PkgWithAmbiguities.g], total - num_ambs_g; broken = true)
check_testcase([PkgWithAmbiguities.g], total - num_ambs_g)

# exclude callables and constructors
check_testcase([PkgWithAmbiguities.SingletonType], total - num_ambs_SingletonType)
Expand Down Expand Up @@ -73,8 +73,7 @@ include("preamble.jl")
PkgWithAmbiguities.ConcreteType,
PkgWithAmbiguities.ConcreteParameterizedType,
],
0;
broken = true,
0,
)
else
# exclude everything
Expand All @@ -85,8 +84,7 @@ include("preamble.jl")
PkgWithAmbiguities.SingletonType,
PkgWithAmbiguities.ConcreteType,
],
0;
broken = true,
0,
)
end

Expand Down

0 comments on commit 8d1c919

Please sign in to comment.