Bitfield generations for bools generate invalid comparison expressions (and errors)
For the get - "Cannot cast expression of type int to bool"
For the set - "Cannot apply operator & to operands of type bool and int.
Here's the relevant struct parts this is generated from:
struct ImGuiDockNode
{
...
bool IsVisible :1;
bool IsFocused :1;
bool IsBgDrawnThisFrame :1;
bool HasCloseButton :1;
bool HasWindowMenuButton :1;
bool HasCentralNodeChild :1;
bool WantCloseAll :1;
bool WantLockSizeOnce :1;
bool WantMouseMove :1;
bool WantHiddenTabBarUpdate :1;
bool WantHiddenTabBarToggle :1;
};
Would a valid library fix here just be doing bool "conversion" by checking > 0 in the get and ternary switching for value in set?
Will take a look in a bit. bool is generally tricky to handle due to it working completely differently between C/C++ and C#. Bitfields are apparently a scenario where I'm missing some of the manual conversions and comparisons that would otherwise be required.
In general it requires cond ? 1 : 0 to convert to a bool cond to an integer value and value != 0 to convert an int value to a boolean.