Files
kotlin-fork/idea/testData/quickfix/nullables/unsafeInfixCall/unsafeComparisonInWhen.kt
T
Dmitry Gridin 6c439ae85a Create TrailingCommaIntention
#KT-34744
2020-02-04 21:34:53 +07:00

14 lines
461 B
Kotlin
Vendored

// "Replace with safe (?.) call" "false"
// ACTION: Add non-null asserted (!!) call
// ACTION: Flip '<='
// ACTION: Enable a trailing comma by default in the formatter
// ACTION: Replace overloaded operator with function call
// ERROR: Operator call corresponds to a dot-qualified call 'w?.x.compareTo(42)' which is not allowed on a nullable receiver 'w?.x'.
class Wrapper(val x: Int)
fun test(w: Wrapper?) {
when {
w?.x <caret><= 42 -> {}
}
}