Acton
Linting rules

E022: negated-is-type-can-use-not-is

Detects negated type checks written as `!(a is T)`.

Metadata

  • Code: E022
  • Rule: negated-is-type-can-use-not-is
  • Status: Stable since v0.0.1
  • Quick fix: always available

What it does

Detects negated type checks written as !(a is T).

Why is this bad?

Tolk has a dedicated !is operator, which is clearer than negating is.

Example

if (!(value is int)) {
E022: negated `is` type check can use `!is`
return; }

Use instead:

if (value !is int) {
    return;
}
Source code

Last updated on

On this page