KT.LATEINIT_USAGE
Usage of the lateinit modifier
Turn on this rule to flag usages of the lateinit modifier. Using lateinit for property initialization can be error-prone and the actual initialization is not guaranteed. Try using constructor injection or delegation to initialize properties.
Noncompliant Code
Copy
class Foo {
private lateinit var i1: Int
lateinit var i2: Int
}
Options
-
excludes
(default:['**/test/**', '**/androidtest/**', '**/commontest/**', '**/jvmtest/**', '**/jstest/**', '**/iostest/**']
)path filters
-
ignoreOnClassesPattern
(default: ``)Allows you to disable the rule for a list of classes