| ## fi-0023: Attribute inside type declaration {:#fi-0023} |
| |
| With [inline layouts](/docs/reference/fidl/language/language.md#inline-layouts), |
| you can put attributes directly before the layout. However, when declaring a |
| type at the top level, you cannot: |
| |
| {% 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-0023.noformat.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %} |
| ``` |
| |
| Instead, you must put attributes before the `type` keyword: |
| |
| {% 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-0023.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %} |
| ``` |
| |
| We enforce this because it would be confusing to allow attributes in two places. |