This is not type-piracy. The type Bad
is defined inside the actual “module” and you define Base.size
on it.
IIUC type piracy is that you define an external function to your module to a type external to it. Something like this
module A
function f() end
end
module B
struct MyType end
end
module C
import ..A: f
import ..B: MyType
function f(x::MyType) end # type piracy
end