Only a type using the struct
layout can be boxed; union
, vector
, string
, client_end
, server_end
, and zx.Handle
must use the optional
constraint instead:
{% include “docs/reference/fidl/language/error-catalog/label/_bad.md” %}
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/bad/fi-0171.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
Convert box<T>
to T:optional
to fix this 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-0171.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, or the expandable below, for more information.
<<../../../../development/languages/fidl/widgets/_optionality.md>>