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

14 lines
509 B
Kotlin
Vendored

// "Replace with safe (?.) call" "false"
// ACTION: Add non-null asserted (!!) call
// ACTION: Flip '>'
// ACTION: Replace '&&' with '||'
// ACTION: Replace overloaded operator with function call
// ACTION: Simplify boolean expression
// ACTION: Expand boolean expression to 'if else'
// 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?) {
val t = 1 < 2 && w?.x <caret>> 42
}