Skip to content

Files

Latest commit

 

History

History
23 lines (14 loc) · 505 Bytes

MayBeConst.md

File metadata and controls

23 lines (14 loc) · 505 Bytes

Pattern: Missing use of const val

Issue: -

Description

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