FIR: Fix incorrect type of block generated for inc operator

Previously, it was obtained from expected type of a variable being assigned,
but it's better to use the type of resulting expression

Initially this part was brought in 4ab0897d7d,
but as we see in commit message and tests it was all about unit-coercion
This commit is contained in:
Denis.Zharkov
2021-11-11 12:55:40 +03:00
committed by teamcityserver
parent a7859e0332
commit c0b6a593e0
17 changed files with 67 additions and 20 deletions
@@ -0,0 +1,13 @@
// SKIP_TXT
var c = 1
fun nullable(): Int? = null
fun foo(): Int {
var x = nullable()
if (x == null) {
x = c++
}
return <!DEBUG_INFO_SMARTCAST!>x<!>
}