Julia 1.14 has new wrapping operators +%, -%, *%. I’m wondering how to support them in packages.
Imagine that I have a package that should also work with earlier versions of Julia. I want to support wrapping operators because users running Julia 1.14 should be able to use them for types defined in my package, or because I’m using methods from Base that internally rely on these new operators in Julia 1.14.
Example: BigInt(x::Integer) internally uses -%(x). BigIntegers.jl uses this constructor to convert the integer types it defines to BigInt (see here).
Now the catch is this: If the [compat] section of my Project.toml lists a Julia version below 1.14, then I’m not allowed to use the new wrapping operators in my package, not even if I’m running Julia 1.14:
julia> 1 +% 2
ERROR: ParseError:
# Error @ REPL[1]:1:2
1 +% 2
#└ ── wrapping arithmetic operators `+%`, `-%`, and `*%` not supported in Julia version 1.13 < 1.14
(For some reason, the error message always says “1.13”, even if an earlier version is given in the Project.toml.)
So what do I do to support wrapping operators?