| ## fi-0075: Invalid primitive used for method payload {:#fi-0075} |
| |
| Primitives cannot be used as method method payload: |
| |
| {% include "docs/reference/fidl/language/error-catalog/label/_bad.md" %} |
| |
| ```fidl |
| {% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/bad/fi-0075.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %} |
| ``` |
| |
| Use a type of the `struct`, `table`, or `union` layout instead: |
| |
| {% include "docs/reference/fidl/language/error-catalog/label/_good.md" %} |
| |
| ```fidl |
| {% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/good/fi-0075.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %} |
| ``` |
| |
| For cases where the desirable payload really is just a primitive value, and |
| future evolution is not a concern, wrapping the value in a `struct` layout will |
| result in a payload that is the same size as desired value is by itself. |