Files
Evgeniy.Zhelenskiy 931f2eab58 [FIR] Remove implicit coercion of ifs and whens to Unit
The rule of thumb is the following:
If the `if` and `when` can be successfully replaced with `while`,
then it is used as a statement, otherwise, it is used as an expression.

#KT-59883
2024-02-21 15:04:03 +00:00

12 lines
173 B
Kotlin
Vendored

package f
fun test(a: Boolean, b: Boolean): Int {
return if(a) {
1
} else {
<!INVALID_IF_AS_EXPRESSION!>if<!> (b) {
3
}
}
}