Roman
06/12/2024, 1:31 PMfun test(c: Boolean, d: Boolean) {
val a = if (c) {
val b = "One"
if (d) {
b
} else {
"Two"
}
} else {
"Three"
}
}
Here, "usedAsExpression" for the outer "if" is true, while for the inner "if" is false. Is that correct? Obviously, the inner "if" is used as expression as well as the outer one.
How can I check that condition beside "usedAsExpression" property?dmitriy.novozhilov
06/12/2024, 1:34 PMFirWhenExpression.usedAsExpression
is initialized only based on source structure without any resolution and it might be not precisedmitriy.novozhilov
06/12/2024, 1:34 PMRoman
06/12/2024, 1:36 PMdmitriy.novozhilov
06/13/2024, 8:02 AMdmitriy.novozhilov
06/13/2024, 8:03 AMusedAsExpression
is an internal implementation detail without any contracts for outer consumers