Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/builderInference/buildListRemoveAddInBranches.fir.kt
T
Simon Ogorodnik d46075a9db K2: Use correct position for substitution constrains in builder inference
Before, we were wrapping the original constraint position into
ConeBuilderInferenceSubstitutionConstraintPosition twice during the
constraint substitution in builder inference.

It was causing problems with diagnostic reporting.

Remove TODOs about diagnostic reporting from FirBuilderInferenceSession.
Propagation of errors from the common system is now implemented
Diagnostic reporting in updateCalls isn't needed, since we
report errors after the system completion unlike K1

Relates to KT-53749
2023-12-04 15:27:21 +00:00

9 lines
157 B
Kotlin
Vendored

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