Relax rules about inferring to Nothing for special calls

#KT-37388 Fixed
 #KT-38427 Fixed
 #KT-39953 Fixed
 #KT-38899 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2020-07-15 10:59:10 +03:00
parent e45cd02b01
commit 100a6f70ca
55 changed files with 424 additions and 264 deletions
+3 -3
View File
@@ -1,10 +1,10 @@
// !WITH_NEW_INFERENCE
val test: Int = <!NI;TYPE_MISMATCH, NI;TYPE_MISMATCH, NI;TYPE_MISMATCH!>if (true) {
val test: Int = if (true) <!NI;TYPE_MISMATCH!>{
when (2) {
1 -> 1
else -> <!OI;NULL_FOR_NONNULL_TYPE!>null<!>
}
}
}<!>
else {
2
}<!>
}
+2 -2
View File
@@ -11,12 +11,12 @@
*/
fun test1(): Int {
val x: String = <!NI;TYPE_MISMATCH!>if (true) {
val x: String = if (true) <!NI;TYPE_MISMATCH!>{
when {
true -> <!OI;TYPE_MISMATCH!>Any()<!>
else -> <!OI;NULL_FOR_NONNULL_TYPE!>null<!>
}
} else ""<!>
}<!> else ""
return x.hashCode()
}