Files
kotlin-fork/idea/testData/quickfix/surroundWithNullCheck/unsafeCallInGetter.kt
T
Mikhail Glukhikh c084eefb65 Fix a bunch of IDE quick-fix tests (related to "convert to run/...")
These actions became available more often some days ago
2019-02-25 10:37:46 +03:00

14 lines
481 B
Kotlin
Vendored

// "Surround with null check" "false"
// ACTION: Add non-null asserted (!!) call
// ACTION: Convert property getter to initializer
// ACTION: Convert to block body
// ACTION: Introduce local variable
// ACTION: Replace with safe (?.) call
// ACTION: Convert to run
// ACTION: Convert to with
// ERROR: Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type String?
class My(val x: String?) {
val y: Int
get() = x<caret>.hashCode()
}