Files
kotlin-fork/idea/testData/quickfix/nullables/unsafeInfixCall/noComparison.kt
T
2017-06-19 17:36:09 +03:00

12 lines
430 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
class SafeType {
operator fun compareTo(other : SafeType) = 0
}
fun safeA(p1: SafeType?, p2: SafeType) {
val v8 = p1 <caret>> p2
}