Files
kotlin-fork/compiler/testData/diagnostics/tests/regressions/kt282.kt
T
Denis.Zharkov 2ecba6ac39 Remove WITH_NEW_INFERENCE directive from all tests
This directive anyway does not make test run twice with OI, and with NI
It only once run the test with specific settings (// LANGUAGE)
and ignores irrelevant (OI or NI tags)
2021-05-25 13:28:26 +03:00

20 lines
416 B
Kotlin
Vendored

// FIR_IDENTICAL
// KT-282 Nullability in extension functions and in binary calls
class Set {
operator fun contains(x : Int) : Boolean = true
}
operator fun Set?.plus(x : Int) : Int = 1
operator fun Int?.contains(x : Int) : Boolean = false
fun f(): Unit {
var set : Set? = null
val i : Int? = null
i <!UNSAFE_OPERATOR_CALL!>+<!> 1
set + 1
1 <!UNSAFE_OPERATOR_CALL!>in<!> set
1 in 2
}