Maintain backwards compatibility when using `const` on a mutable struct field

Hmmm.

You could put the 1.6-compatible struct definition in one source code file, and put the 1.8-compatible struct definition in another file. And then your package would have code of the form:

if VERSION >= v"1.8"
    include("structs-1.8.jl")
else
    include("structs-1.6.jl")
end
3 Likes