blob: f36109411c8d13aaf27140e59ffadf48e8948a7c [file] [log] [blame] [view]
## fi-0131: Duplicate canonical attribute argument {:#fi-0131}
An attribute cannot have two arguments 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-0131.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
```
Even though `custom_arg` and `CustomArg` look different, they are both
represented by the **canonical** name `custom_arg`. You get the canonical name
by converting the original name to `snake_case`.
To fix the error, give each argument 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-0131-a.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
```
Alternatively, remove one of the arguments:
{% 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-0131-b.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.