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.
22 lines
392 B
Kotlin
Vendored
22 lines
392 B
Kotlin
Vendored
// !WITH_NEW_INFERENCE
|
|
fun foo(arg: Int?): Int {
|
|
var i = arg
|
|
if (i != null && i++ == 5) {
|
|
return i-- + i
|
|
}
|
|
return 0
|
|
}
|
|
|
|
operator fun Long?.inc() = this?.let { it + 1 }
|
|
|
|
fun bar(arg: Long?): Long {
|
|
var i = arg
|
|
if (i++ == 5L) {
|
|
return i<!UNSAFE_CALL!>--<!> + i
|
|
}
|
|
if (i++ == 7L) {
|
|
return i++ <!NONE_APPLICABLE!>+<!> i
|
|
}
|
|
return 0L
|
|
}
|