Skip to content

Files

Latest commit

 

History

History
25 lines (16 loc) · 507 Bytes

UnnecessaryNotNullCheck.md

File metadata and controls

25 lines (16 loc) · 507 Bytes

Pattern: Unnecessary not-null check

Issue: -

Description

Reports unnecessary not-null checks with requireNotNull or checkNotNull that can be removed by the user.

Example of incorrect code:

var string = "foo"
println(requireNotNull(string))

Example of correct code:

var string : String? = "foo"
println(requireNotNull(string))

Further Reading