blob: ca8eeb3290552abdbad8d2b3637636ba6e7b9de9 [file] [log] [blame] [view]
## fi-0037: Canonical name overlap {:#fi-0037}
Declarations with the same canonical name cannot have overlapping
availabilities:
{% 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-0037.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
```
Even though `COLOR` and `Color` look different, they are both represented by the
**canonical** name `color`. You get the canonical name by converting the
original name to `snake_case`.
To fix the error, give each declaration a name that is unique after
canonicalization.
{% 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-0037.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
```
Alternatively, change one of the declarations availabilities as shown in
[fi-0036](#fi-0036), or remove the declaration.
See [fi-0035](#fi-0035) for more details on why FIDL requires declarations to
have unique canonical names.