diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/KotlinConstraintSystemCompleter.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/KotlinConstraintSystemCompleter.kt index 55a36da9635..7e7bd091a01 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/KotlinConstraintSystemCompleter.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/KotlinConstraintSystemCompleter.kt @@ -226,6 +226,11 @@ class KotlinConstraintSystemCompleter( if (!argument.atom.hasBuilderInferenceAnnotation && !useBuilderInferenceWithoutAnnotation) continue + // Imitate having builder inference annotation. TODO: Remove after getting rid of @BuilderInference + if (!argument.atom.hasBuilderInferenceAnnotation && useBuilderInferenceWithoutAnnotation) { + argument.atom.hasBuilderInferenceAnnotation = true + } + val notFixedInputTypeVariables = argument.inputTypes .flatMap { it.extractTypeVariables() }.filter { it !in fixedTypeVariables } diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/kt49828.kt b/compiler/testData/diagnostics/tests/inference/builderInference/kt49828.kt index 67364b1a5bf..606c68cf020 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/kt49828.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/kt49828.kt @@ -209,13 +209,13 @@ fun test() { add("") with (get()) { with (listOf(1)) { - bar() + bar() } } }, { put(1, "one") - foo11(entries()) + foo11(entries()) } ) }