Seelengrab / FieldFlags.jl

A small package for creating bitfield-like structs.
https://seelengrab.github.io/FieldFlags.jl/
MIT License
11 stars 0 forks source link

Allow declaration of subtyping in DSL #8

Closed Seelengrab closed 1 year ago

Seelengrab commented 1 year ago

So that the following works:

abstract type MyInternalAbstract end

@bitfield struct Foo <: MyinternalAbstract
    a:2
end

@bitflags struct Bar <: MyinternalAbstract
    a
end

The place to add this is here:

https://github.com/Seelengrab/FieldFlags.jl/blob/2d58554104ccadf94f3209634ac89678936de160/src/FieldFlags.jl#L168-L180

When adding this, it's likely good to move away from interpolation here and to explicit Expr creation instead, which is likely going to be much more future proof.