Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDL compiler allow optional key when nested in struct #2151

Closed
AlexisPotvinARA opened this issue Dec 16, 2024 · 0 comments · Fixed by #2154
Closed

IDL compiler allow optional key when nested in struct #2151

AlexisPotvinARA opened this issue Dec 16, 2024 · 0 comments · Fixed by #2154

Comments

@AlexisPotvinARA
Copy link
Contributor

The IDL compiler allows a value to be an optional key when the optional annotation is nested inside a struct. However, this behavior is not consistent with the specification in 7.2.2.4.4.4.8 Key Members, which states that "Key members shall never be optional, and they shall always have their 'must understand' bit set." To resolve this discrepancy, the IDL compiler and type object validation code should block this behavior.

Here is an example data structure that can be used to validate the error.

struct Plate {
    string number;
    @optional string state;
};
struct Car {
    @key Plate licensePlate;
    string color;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant