c458393e2f
Since we skipped trivial constraint with `Any?` from parameter type of function `equals`, the compiler thought that there is no proper constraints (upper bounds do not matter here) and marked resolved call as a failed one, then diagnostic about missing equals was added Also, tune `TrivialConstraintTypeInferenceOracle` for `Any?`-like constraints #KT-30724 Fixed
12 lines
307 B
Kotlin
Vendored
12 lines
307 B
Kotlin
Vendored
// !WITH_NEW_INFERENCE
|
|
// !DIAGNOSTICS: -DEBUG_INFO_SMARTCAST
|
|
fun bar(x: Int): Int = x + 1
|
|
|
|
fun foo() {
|
|
val x: Int? = null
|
|
|
|
bar(1 + (if (x == null) 0 else x))
|
|
bar(<!NI;TYPE_MISMATCH!>if (x == null) <!DEBUG_INFO_CONSTANT, OI;TYPE_MISMATCH!>x<!> else x<!>)
|
|
if (x != null) bar(x + x/(x-x*x))
|
|
}
|