Files
kotlin-fork/idea/testData/quickfix/nullables/unsafeInfixCall/noComparison.kt
T
Toshiaki Kameyama 343af60cb4 Add intention to expand boolean expression
#KT-38597 Fixed
2020-06-02 23:52:06 +03:00

13 lines
480 B
Kotlin
Vendored

// "Replace with safe (?.) call" "false"
// ERROR: Operator call corresponds to a dot-qualified call 'p1.compareTo(p2)' which is not allowed on a nullable receiver 'p1'.
// ACTION: Add non-null asserted (!!) call
// ACTION: Flip '>'
// ACTION: Replace overloaded operator with function call
// ACTION: Expand boolean expression to 'if else'
class SafeType {
operator fun compareTo(other : SafeType) = 0
}
fun safeA(p1: SafeType?, p2: SafeType) {
val v8 = p1 <caret>> p2
}