Open
Description
Currently, const
-per-field annotations are not allowed by the interface, but it would be nice to support this.
The way this would be implemented is by allowing the annotation through here:
FieldFlags.jl/src/FieldFlags.jl
Lines 154 to 165 in 6267ca5
as well as simply not generating the various setindex!
branches here:
FieldFlags.jl/src/FieldFlags.jl
Lines 239 to 256 in 6267ca5
Annotating a field with const
currently doesn't error, but the field is ignored entirely, so adding this shouldn't break anything:
julia> @bitfield mutable struct Foo
const a:2
b:3
end
julia> methods(Foo)
# 3 methods for type constructor:
[1] Foo()
@ none:0
[2] Foo(t::Foo_fields)
@ none:0
[3] Foo(b::Union{Bool, Int128, Int16, Int32, Int64, Int8, UInt128, UInt16, UInt32, UInt64, UInt8})
@ none:0