File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ using Base: PkgId, UUID
44using Pkg: Pkg, TOML
55using Test
66
7+ const JULIA_HAS_EXTENSIONS = isdefined (Base, :get_extension ) # introduced in v1.9
8+
79try
810 findnext (' a' , " a" , 1 )
911catch
Original file line number Diff line number Diff line change 11module Piracy
22
3+ using Aqua: JULIA_HAS_EXTENSIONS
4+
35if VERSION >= v " 1.6-"
46 using Test: is_in_mods
57else
160162function is_pirate (meth:: Method ; treat_as_own = Union{Function,Type}[])
161163 method_pkg = Base. PkgId (meth. module)
162164
165+ # Package extensions behave as the package itself
166+ @static if JULIA_HAS_EXTENSIONS
167+ method_pkg = get (Base. EXT_PRIMED, method_pkg, method_pkg)
168+ end
169+
163170 signature = Base. unwrap_unionall (meth. sig)
164171
165172 # the first parameter in the signature is the function type, and it
You can’t perform that action at this time.
0 commit comments