blob: 994e2916130e57c3ef828208d918fde03003735d [file] [log] [blame] [view]
## fi-0025: Imports group must be at top of file {:#fi-0025}
Except for the `library` declaration at the top of the file, there cannot be any
other declarations before the `using` imports for the file, should they exist:
{% 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-0025.noformat.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
```
To resolve this error, place all of your `using` imports in a block directly
after the `library` declaration:
{% 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-0025.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
```
This rule reflects a primarily aesthetic decision by the FIDL team that
dependencies are easier to read when they are well-grouped and easily located.