Not all types can used in const
declarations:
{% include “docs/reference/fidl/language/error-catalog/label/_bad.md” %}
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/bad/fi-0059.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
Convert to an allowed type, if possible:
{% include “docs/reference/fidl/language/error-catalog/label/_good.md” %}
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/good/fi-0059.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
Only FIDL primitives (bool
, int8
, int16
, int32
, int64
, uint8
, uint16
, uint32
, uint64
, float32
, float64
) and non-optional string
types may be used in the left-hand side of a const
declaration.