Skip to content

Commit db4a0aa

Browse files
committed
Extensions do not commit piracy against base package
1 parent 9ae3c19 commit db4a0aa

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/Aqua.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ using Base: PkgId, UUID
44
using Pkg: Pkg, TOML
55
using Test
66

7+
const HAS_EXTENSIONS = isdefined(Base, :get_extension) # introduced in v1.9
8+
79
try
810
findnext('a', "a", 1)
911
catch

src/piracy.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
module Piracy
22

3+
using Aqua: HAS_EXTENSIONS
4+
35
if VERSION >= v"1.6-"
46
using Test: is_in_mods
57
else
@@ -159,6 +161,9 @@ end
159161

160162
function is_pirate(meth::Method; treat_as_own = Union{Function,Type}[])
161163
method_pkg = Base.PkgId(meth.module)
164+
@static if HAS_EXTENSIONS
165+
method_pkg = get(Base.EXT_PRIMED, method_pkg, method_pkg)
166+
end
162167

163168
signature = Base.unwrap_unionall(meth.sig)
164169

0 commit comments

Comments
 (0)