Files
Vladimir Dolzhenko 98cb6d673f [kotlin] Surround with null check should not be available for non-stable variables
#KTIJ-30588 Fixed

GitOrigin-RevId: f30dfd5da1172748b1bbd8136a0a8657676ec446
2024-07-11 16:56:33 +00:00

14 lines
408 B
Kotlin

// "Surround with null check" "false"
// ACTION: Add non-null asserted (x!!) call
// ACTION: Convert to run
// ACTION: Convert to with
// ACTION: Introduce import alias
// ACTION: Introduce local variable
// ACTION: Replace with safe (?.) call
// ERROR: Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Int?
var x: Int? = null
fun foo() {
x<caret>.hashCode()
}