.llms/rules/ACR_prefer_kotlin.md
Severity: MEDIUM — Team standard from D92851254, D89896459 reviewer feedback
!! (non-null assertion) operatorcheckNotNull() instead of ?.let!! operator: Prefer safe calls (?.) or explicit null handlingcheckNotNull(x).doSomething(): Prefer x?.let { it.doSomething() }!! in test assertions where crash is intentional// BAD — Non-null assertion can crash
val result = maybeNull!!.process() // ❌ Crashes if null
// GOOD — Safe call with let
maybeNull?.let { result = it.process() } // ✅ Safe
// GOOD — Elvis operator for default
val result = maybeNull?.process() ?: defaultValue // ✅ Safe
?.let, ?:, ?. instead of !! or checkNotNull()