Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 516 Bytes

MayBeConstant.md

File metadata and controls

25 lines (16 loc) · 516 Bytes

Pattern: Missing use of const val

Issue: -

Description

This rule 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"

Further Reading