You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by Danaozhong May 19, 2024
The zserio specification about bitmasks states the following:
In expressions outside of the defining type, bitmask values must always be prefixed by the type name and a dot, e.g. Permission.WRITABLE.
This doesn't seem to apply to the isset() operator, as the example provided shows that writing the following is possible: return isset(testBitmask, INT);
This example also compiles with zserio (tested version 2.11.0).
This code does not compile: return ((testBitmask & INT) == TestBitmask.INT);
The isset() example is not within the defining type, but omits the type name and dot. Based on the documentation of bitmask types, I would have expected only the following syntax to be legal: return isset(testBitmask, TestBitmask.INT);
That feels a bit inconsistent to me. Of course, it makes sense that isset() can deduce the bitmask type from the first operand, but it seems to contradict the documentation.
The text was updated successfully, but these errors were encountered:
Discussed in #617
Originally posted by Danaozhong May 19, 2024
The
zserio
specification about bitmasks states the following:This doesn't seem to apply to the
isset()
operator, as the example provided shows that writing the following is possible:return isset(testBitmask, INT);
This example also compiles with
zserio
(tested version 2.11.0).This code does not compile:
return ((testBitmask & INT) == TestBitmask.INT);
The
isset()
example is not within the defining type, but omits the type name and dot. Based on the documentation of bitmask types, I would have expected only the following syntax to be legal:return isset(testBitmask, TestBitmask.INT);
That feels a bit inconsistent to me. Of course, it makes sense that
isset()
can deduce the bitmask type from the first operand, but it seems to contradict the documentation.The text was updated successfully, but these errors were encountered: