e72ddbcbfe
To do so, inside the root cause of inapplicable candidate errors, we will record expected/actual type of receiver, if any. That will help identifying inapplicable calls on nullable receiver.
20 lines
408 B
Kotlin
Vendored
20 lines
408 B
Kotlin
Vendored
// !WITH_NEW_INFERENCE
|
|
// 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 <!NONE_APPLICABLE!>+<!> 1
|
|
set + 1
|
|
1 <!UNSAFE_CALL!>in<!> set
|
|
1 in 2
|
|
}
|