Skip to content

Commit

Permalink
Extensions do not commit piracy against base package
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Jul 18, 2023
1 parent 9ae3c19 commit db4a0aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Aqua.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/piracy.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module Piracy

using Aqua: HAS_EXTENSIONS

if VERSION >= v"1.6-"
using Test: is_in_mods
else
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit db4a0aa

Please sign in to comment.