Acton
Linting rules

E019: several-not-null-assertions

Detects repeated not-null assertions like `foo!!`.

Metadata

  • Code: E019
  • Rule: several-not-null-assertions
  • Status: Stable since v0.0.1
  • Quick fix: always available

What it does

Detects repeated not-null assertions like foo!!.

Why is this bad?

Repeating ! is redundant: after the first not-null assertion the value is already non-null.

Example

val x = foo!!;
E019: several not-null assertions in a row

Use instead:

val x = foo!;
Source code

Last updated on

On this page