[FIR] Infer type of elvis from lhs if rhs is Nothing

^KT-50875 Fixed
This commit is contained in:
Dmitriy Novozhilov
2022-01-21 17:42:14 +03:00
parent 83ff0946fe
commit d1fb8338ef
8 changed files with 73 additions and 4 deletions
+2 -2
View File
@@ -20,9 +20,9 @@ fun test1(): Int {
}
fun test2(): Int {
val x: String = when {
val x: String = <!INITIALIZER_TYPE_MISMATCH!>when {
true -> Any()
else -> null
} ?: return 0
} ?: return 0<!>
return x.hashCode()
}