When an element is marked @available(replaced=N)
, it indicates that the element is replaced by a new definition marked @available(added=N)
. The FIDL compiler will report an error if it cannot find such a definition:
{% include “docs/reference/fidl/language/error-catalog/label/_bad.md” %}
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/bad/fi-0206.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
If you did not intend to replace the element, use the removed
argument instead of the replaced
argument:
{% include “docs/reference/fidl/language/error-catalog/label/_good.md” %}
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/good/fi-0206-a.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
If you intended to replace the element, add a replacement definition:
{% include “docs/reference/fidl/language/error-catalog/label/_good.md” %}
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/good/fi-0206-b.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
The removed
and replaced
arguments both have the same effect on the generated bindings, but they represent different points in API lifecycle. The removed
argument indicates the end of an API, while the replaced
argument indicates a transition to a new definition.
See FIDL versioning to learn more about versioning.