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:
committed by
teamcityserver
parent
a7859e0332
commit
c0b6a593e0
+13
@@ -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 x
|
||||
}
|
||||
Reference in New Issue
Block a user