FIR: Fix inference for case of non-nullable RHS of elvis

Some existing tests start failing after previous commits adding @Exact
attribute to `?:`

They have a form:
var x: String? = nullable()

if (x == null) {
   x = nullable() ?: "" // considering @Exact the whole elvis is inferred to nullable from expect type
}

x.length // should be smart cast
This commit is contained in:
Denis.Zharkov
2021-11-15 16:16:19 +03:00
committed by teamcityserver
parent 883b18a0c6
commit 3ec7866ead
2 changed files with 15 additions and 1 deletions
@@ -14,7 +14,7 @@ FILE: ifElvisReturn.kt
R|<local>/b|
}
else -> {
R|/materialize|<R|kotlin/Nothing|>() ?: ^foo Unit
R|/materialize|<R|B|>() ?: ^foo Unit
}
}