zserio
zserio copied to clipboard
Consider to fire warning in case of access to choice field
The following schema shows an example of access to the choice field (see it in streamlit):
package sample;
choice Choice(uint8 selector) on selector
{
case 0:
uint32 value;
default:
string text;
};
struct Main
{
uint8 selector;
Choice(selector) choiceField;
uint32 id : id != choiceField.value;
};
There is a constraint id != choiceField.value
which accesses the choice field value
without explicit check of choice selector (should be always 0
).
It would be good to fire at least warning that such construct can be dangerous.