[FE 1.0] Imitate having builder inference annotation while trying resolve with a builder inference

^KT-52892 Fixed
This commit is contained in:
Victor Petukhov
2022-06-18 18:54:05 +02:00
parent fa7809cd80
commit 9e8ef56cca
2 changed files with 7 additions and 2 deletions
@@ -226,6 +226,11 @@ class KotlinConstraintSystemCompleter(
if (!argument.atom.hasBuilderInferenceAnnotation && !useBuilderInferenceWithoutAnnotation) if (!argument.atom.hasBuilderInferenceAnnotation && !useBuilderInferenceWithoutAnnotation)
continue 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 val notFixedInputTypeVariables = argument.inputTypes
.flatMap { it.extractTypeVariables() }.filter { it !in fixedTypeVariables } .flatMap { it.extractTypeVariables() }.filter { it !in fixedTypeVariables }
@@ -209,13 +209,13 @@ fun test() {
add("") add("")
with (get()) { with (get()) {
with (listOf(1)) { with (listOf(1)) {
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, OVERLOAD_RESOLUTION_AMBIGUITY!>bar<!>() <!STUB_TYPE_IN_RECEIVER_CAUSES_AMBIGUITY!><!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, OVERLOAD_RESOLUTION_AMBIGUITY, OVERLOAD_RESOLUTION_AMBIGUITY_BECAUSE_OF_STUB_TYPES!>bar<!>()<!>
} }
} }
}, },
{ {
put(1, "one") put(1, "one")
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, OVERLOAD_RESOLUTION_AMBIGUITY!>foo11<!>(entries()) <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, OVERLOAD_RESOLUTION_AMBIGUITY, OVERLOAD_RESOLUTION_AMBIGUITY_BECAUSE_OF_STUB_TYPES!>foo11<!>(<!STUB_TYPE_IN_ARGUMENT_CAUSES_AMBIGUITY!>entries()<!>)
} }
) )
} }