Error codes

E0411: effect declared but not used

In a terminal: auk explain E0411 prints this page.

On this page

A warning: the function declares an effect it never uses. Declaring only what a function needs keeps callers and the package's raft.toml accurate. It doesn't fail auk check; the fix removes the unused effect.

Wrong#

auk
fn double(n: int): int uses fs = n * 2
fn main() uses fs { print(double(2)) }

Fixed#

auk
fn double(n: int): int = n * 2
fn main() { print(double(2)) }

Common causes#

  • An effect left behind after the code using it was removed or moved.
  • Declaring effects "just in case": add them when the code needs them.

Stuck on a word? Try the glossary. Got a compiler error? Look up its code. Improve this page