fi-0020: Invalid protocol member {:#fi-0020}

This error occurs when an item in a protocol is not recognized as a valid protocol member such as when something in a protocol is not a protocol composition, one-way method, two-way method, or event.

{% include “docs/reference/fidl/language/error-catalog/label/_bad.md” %}

{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/bad/fi-0020.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}

To fix this error, remove the invalid items or convert them to the correct syntax for the type of protocol item they were intended to be.

{% include “docs/reference/fidl/language/error-catalog/label/_good.md” %}

{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/good/fi-0020.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}

Note: FIDL protocols may only contain compose statements, one-way methods, two-way methods, and events. Attempting to place any other kind of declaration directly within a protocol is an error. Declarations for other protocols and named types can be placed outside of the protocol block. Anonymous types for methods and events can be placed inside of the method declaration, but not directly in the protocol body.