Pattern: Missing use of const val
Issue: -
Identifies and reports properties (val
) that may be const val
instead. Using const val
can lead to better performance of the resulting bytecode as well as better interoperability with Java.
Example of incorrect code:
val myConstant = "abc"
Example of correct code:
const val MY_CONSTANT = "abc"