Right, type piracy is defining function f(x::T) where you “own” neither f nor T. If f is your own function, or T is a type you defined, there’s no issue at all. But even if neither is true, it still might be OK. It’s just a smell that something bad might be happening, such as:
- The author/designer of
freally did not want it to support typeT, so you’re misunderstanding what the function is supposed to mean. - The code is in the wrong place, and should be moved to where
forTis defined.
But if everything seems to be in order, pirate away.