Acton
Linting rules

E007: pure-function-call-unused

Checks for calls to `@pure` functions where the result is not used.

Metadata

  • Code: E007
  • Rule: pure-function-call-unused
  • Status: Stable since v0.0.1
  • Quick fix: not available

What it does

Checks for calls to @pure functions where the result is not used.

Why is this bad?

@pure functions have no side effects, so calling them without using the result is a no-op and likely a bug.

Example

@pure
fun add(a: int, b: int): int { return a + b; }

fun main() {
    add(1, 2);
E007: result of pure function is not used
}
Source code

Last updated on

On this page