Structs cannot have the optional
constraint:
{% include “docs/reference/fidl/language/error-catalog/label/_bad.md” %}
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/bad/fi-0159.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
Change T:optional
to box<T>
to fix the issue:
{% include “docs/reference/fidl/language/error-catalog/label/_good.md” %}
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/good/fi-0159.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
Only FIDL types that can be made optional with no change to the wire shape are allowed to use the optional
constraint. See the optionality guide for more information.