summaryrefslogtreecommitdiff
path: root/plugins/kotlin/idea/tests/testData/quickfix/nullables/unsafeInfixCall/unsafeComparisonInLogic.kt
blob: d8a96086037983ea7248396decfde5a9223770fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// "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
}