diff --git a/src/Aqua.jl b/src/Aqua.jl index 2f203016..b3253124 100644 --- a/src/Aqua.jl +++ b/src/Aqua.jl @@ -4,6 +4,8 @@ using Base: PkgId, UUID using Pkg: Pkg, TOML using Test +const HAS_EXTENSIONS = isdefined(Base, :get_extension) # introduced in v1.9 + try findnext('a', "a", 1) catch diff --git a/src/piracy.jl b/src/piracy.jl index e29018bf..5d8193cf 100644 --- a/src/piracy.jl +++ b/src/piracy.jl @@ -1,5 +1,7 @@ module Piracy +using Aqua: HAS_EXTENSIONS + if VERSION >= v"1.6-" using Test: is_in_mods else @@ -159,6 +161,9 @@ end function is_pirate(meth::Method; treat_as_own = Union{Function,Type}[]) method_pkg = Base.PkgId(meth.module) + @static if HAS_EXTENSIONS + method_pkg = get(Base.EXT_PRIMED, method_pkg, method_pkg) + end signature = Base.unwrap_unionall(meth.sig)