Skip to content

Commit

Permalink
[FE 1.0] Imitate having builder inference annotation while trying res…
Browse files Browse the repository at this point in the history
…olve with a builder inference

^KT-52892 Fixed
  • Loading branch information
petukhovv committed Jun 25, 2022
1 parent 304bf92 commit a449dda
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,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 }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ interface Foo2<K, V> {
fun entries(): MutableSet<MutableMap.MutableEntry<K, V>>
}

fun <L, K, V> twoBuilderLambdas(@BuilderInference block: Foo<L>.() -> Unit, @BuilderInference block2: Foo2<K, V>.() -> Unit) {}
fun <L, K, V> twoBuilderLambdas(block: Foo<L>.() -> Unit, block2: Foo2<K, V>.() -> Unit) {}

fun test() {
twoBuilderLambdas(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ interface Foo2<K, V> {
fun entries(): MutableSet<MutableMap.MutableEntry<K, V>>
}

fun <L, K, V> twoBuilderLambdas(@BuilderInference block: Foo<L>.() -> Unit, @BuilderInference block2: Foo2<K, V>.() -> Unit) {}
fun <L, K, V> twoBuilderLambdas(block: Foo<L>.() -> Unit, block2: Foo2<K, V>.() -> Unit) {}

fun test() {
twoBuilderLambdas(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public fun foo11(/*0*/ x: kotlin.collections.MutableSet<kotlin.collections.Mutab
@kotlin.jvm.JvmName(name = "foo111") public fun foo11(/*0*/ x: kotlin.collections.MutableSet<kotlin.collections.MutableMap.MutableEntry<kotlin.String, kotlin.Int>>): kotlin.Unit
public fun main(): kotlin.Unit
public fun test(): kotlin.Unit
public fun </*0*/ L, /*1*/ K, /*2*/ V> twoBuilderLambdas(/*0*/ @kotlin.BuilderInference block: Foo<L>.() -> kotlin.Unit, /*1*/ @kotlin.BuilderInference block2: Foo2<K, V>.() -> kotlin.Unit): kotlin.Unit
public fun </*0*/ L, /*1*/ K, /*2*/ V> twoBuilderLambdas(/*0*/ block: Foo<L>.() -> kotlin.Unit, /*1*/ block2: Foo2<K, V>.() -> kotlin.Unit): kotlin.Unit
public fun kotlin.Int.bar(): kotlin.Unit
@kotlin.jvm.JvmName(name = "bar1") public fun kotlin.String.bar(): kotlin.Unit
public fun kotlin.Int.foo0003(/*0*/ y: kotlin.Number, /*1*/ z: kotlin.String): kotlin.Unit
Expand Down

0 comments on commit a449dda

Please sign in to comment.