Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/builderInference/buildListRemoveAddInBranches.fir.kt
T
Mikhail Glukhikh 75ecba5a4a Tests/PCLA: extend the test for KT-55168
#KT-55168 As Designed
2024-03-01 17:02:49 +00:00

17 lines
268 B
Kotlin
Vendored

// ISSUE: KT-55168
fun foo(arg: Boolean) = buildList {
if (arg) {
removeLast()
} else {
add(<!ARGUMENT_TYPE_MISMATCH!>42<!>)
}
}
fun bar(arg: Boolean) = buildList {
if (!arg) {
add(42)
} else {
removeLast()
}
}