| ## fi-0123: Duplicate canonical attribute name {:#fi-0123} |
| |
| An element cannot have multiple attributes with the same canonical name: |
| |
| {% 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-0123.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %} |
| ``` |
| |
| Even though `custom_attribute` and `CustomAttribute` look different, they are |
| both represented by the **canonical** name `custom_attribute`. You get the |
| canonical name by converting the original name to `snake_case`. |
| |
| To fix the error, give each attribute 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-0123.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %} |
| ``` |
| |
| See [fi-0035](#fi-0035) for more details on why FIDL requires declarations to |
| have unique canonical names. |