Closed protocols are not allowed to contain flexible one-way methods:
{% include “docs/reference/fidl/language/error-catalog/label/_bad.md” %}
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/bad/fi-0116.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
Instead, mark the one-way method strict
instead of flexible
:
{% include “docs/reference/fidl/language/error-catalog/label/_good.md” %}
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/good/fi-0116-a.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
Alternatively, mark the protocol ajar
or open
instead of closed
:
{% include “docs/reference/fidl/language/error-catalog/label/_good.md” %}
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/good/fi-0116-b.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
This error exists because the purpose of the closed
modifier is to make sure a method does not contain any flexible methods. When first creating a protocol, you should carefully think about whether it should be closed, ajar, or open based on the evolvability properties you need from it.
See RFC-0138: Handling unknown interactions for more information about protocol modifiers.