| ## fi-0090: Duplicate canonical struct member name {:#fi-0090} |
| |
| Canonical struct member names cannot be repeated: |
| |
| {% 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-0090.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %} |
| ``` |
| |
| Even though `myStructMember` and `MyStructMember` look different, they are both |
| represented by the **canonical** name `my_struct_member`. You get the canonical |
| name by converting the original name to `snake_case`. |
| |
| To fix the error, give each member 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-0090.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. |