diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/builderInference.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/builderInference.kt index 36d5a357534..5a6ba02cc92 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/builderInference.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/builderInference.kt @@ -1,4 +1,4 @@ -fun foo(@BuilderInference block: MutableList.() -> Unit): T = null!! +fun foo(@BuilderInference block: MutableList.() -> Unit): T = null!! fun takeString(s: String) {} diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/builderInferenceFromStdlib.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/builderInferenceFromStdlib.kt index 24b0e564137..e21fc1cd012 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/builderInferenceFromStdlib.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/builderInferenceFromStdlib.kt @@ -12,7 +12,7 @@ fun test_2() { takeList(list) } -fun myBuildList(@BuilderInference builderAction: MutableList.() -> Unit): List { +fun myBuildList(@BuilderInference builderAction: MutableList.() -> Unit): List { return ArrayList().apply(builderAction) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/KtFirCompositeScope.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/KtFirCompositeScope.kt index 8957b783f92..93a49969839 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/KtFirCompositeScope.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/KtFirCompositeScope.kt @@ -2,7 +2,7 @@ interface KtScope { fun getAllNames(): Set } -inline fun buildSet(@BuilderInference builderAction: MutableSet.() -> Unit): Set { +inline fun buildSet(@BuilderInference builderAction: MutableSet.() -> Unit): Set { return null!! } diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 6c61bc2a5ca..3ca6422f1ae 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -19397,6 +19397,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/inference/builderInferenceLeakingVariable.kt"); } + @Test + @TestMetadata("builderInferenceWithAnnotation.kt") + public void testBuilderInferenceWithAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/inference/builderInferenceWithAnnotation.kt"); + } + @Test @TestMetadata("capturedStarProjection.kt") public void testCapturedStarProjection() throws Exception { diff --git a/compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_3.kt b/compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_3.kt index 5518a63243e..f8ec24639ef 100644 --- a/compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_3.kt +++ b/compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_3.kt @@ -20,7 +20,7 @@ interface AsyncIterator { } @OptIn(ExperimentalTypeInference::class) -fun asyncGenerate(@BuilderInference block: suspend AsyncGenerator.() -> Unit): AsyncSequence = object : AsyncSequence { +fun asyncGenerate(block: suspend AsyncGenerator.() -> Unit): AsyncSequence = object : AsyncSequence { override fun iterator(): AsyncIterator { val iterator = AsyncGeneratorIterator() iterator.nextStep = block.createCoroutine(receiver = iterator, completion = iterator) diff --git a/compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_3.kt b/compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_3.kt index ea9d202d869..11eb467845e 100644 --- a/compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_3.kt +++ b/compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_3.kt @@ -20,7 +20,7 @@ interface AsyncIterator { } @OptIn(ExperimentalTypeInference::class) -fun asyncGenerate(@BuilderInference block: suspend AsyncGenerator.() -> Unit): AsyncSequence = object : AsyncSequence { +fun asyncGenerate(block: suspend AsyncGenerator.() -> Unit): AsyncSequence = object : AsyncSequence { override fun iterator(): AsyncIterator { val iterator = AsyncGeneratorIterator() iterator.nextStep = block.createCoroutine(receiver = iterator, completion = iterator) diff --git a/compiler/testData/codegen/box/coroutines/asyncIterator_1_3.kt b/compiler/testData/codegen/box/coroutines/asyncIterator_1_3.kt index 566ec45efe3..ac1319b20ae 100644 --- a/compiler/testData/codegen/box/coroutines/asyncIterator_1_3.kt +++ b/compiler/testData/codegen/box/coroutines/asyncIterator_1_3.kt @@ -20,7 +20,7 @@ interface AsyncIterator { } @OptIn(ExperimentalTypeInference::class) -fun asyncGenerate(@BuilderInference block: suspend AsyncGenerator.() -> Unit): AsyncSequence = object : AsyncSequence { +fun asyncGenerate(block: suspend AsyncGenerator.() -> Unit): AsyncSequence = object : AsyncSequence { override fun iterator(): AsyncIterator { val iterator = AsyncGeneratorIterator() iterator.nextStep = block.createCoroutine(receiver = iterator, completion = iterator) diff --git a/compiler/testData/codegen/box/coroutines/builderInferenceAndGenericArrayAcessCall.kt b/compiler/testData/codegen/box/coroutines/builderInferenceAndGenericArrayAcessCall.kt index be96d49a938..94c6f118f35 100644 --- a/compiler/testData/codegen/box/coroutines/builderInferenceAndGenericArrayAcessCall.kt +++ b/compiler/testData/codegen/box/coroutines/builderInferenceAndGenericArrayAcessCall.kt @@ -7,7 +7,7 @@ interface Foo class FooImpl : Foo @OptIn(ExperimentalTypeInference::class) -fun myflow(@BuilderInference block: Foo.() -> Unit): Foo { +fun myflow(block: Foo.() -> Unit): Foo { val impl = FooImpl() impl.block() return impl diff --git a/compiler/testData/codegen/box/coroutines/emptyCommonConstraintSystemForCoroutineInferenceCall.kt b/compiler/testData/codegen/box/coroutines/emptyCommonConstraintSystemForCoroutineInferenceCall.kt index bb10cd21542..2be3b030ba5 100644 --- a/compiler/testData/codegen/box/coroutines/emptyCommonConstraintSystemForCoroutineInferenceCall.kt +++ b/compiler/testData/codegen/box/coroutines/emptyCommonConstraintSystemForCoroutineInferenceCall.kt @@ -61,10 +61,10 @@ suspend inline fun hang(onCancellation: () -> Unit) {} fun Flow.flatMap(mapper: suspend (T) -> Flow): Flow = TODO() @OptIn(ExperimentalTypeInference::class) -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit): Flow = TODO() +fun flow(block: suspend FlowCollector.() -> Unit): Flow = TODO() @OptIn(ExperimentalTypeInference::class) -inline fun Flow.flatMapLatest(@BuilderInference crossinline transform: suspend (value: T) -> Flow): Flow = TODO() +inline fun Flow.flatMapLatest(crossinline transform: suspend (value: T) -> Flow): Flow = TODO() interface Flow diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/funInterface/kt49294.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/funInterface/kt49294.kt index 7072f9432c7..beaafafa268 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/funInterface/kt49294.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/funInterface/kt49294.kt @@ -23,7 +23,7 @@ suspend fun Flow.toList(): List { return destination } -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit): Flow = SafeFlow(block) +fun flow(block: suspend FlowCollector.() -> Unit): Flow = SafeFlow(block) private class SafeFlow(private val block: suspend FlowCollector.() -> Unit) : Flow { override suspend fun collect(collector: FlowCollector) { @@ -31,7 +31,7 @@ private class SafeFlow(private val block: suspend FlowCollector.() -> Unit } } -fun channelFlow(@BuilderInference block: suspend SendChannel.() -> Unit): Flow = +fun channelFlow(block: suspend SendChannel.() -> Unit): Flow = ChannelFlowBuilder(block) private open class ChannelFlowBuilder( diff --git a/compiler/testData/codegen/box/coroutines/kt30858.kt b/compiler/testData/codegen/box/coroutines/kt30858.kt index 663813cbd26..4648981b735 100644 --- a/compiler/testData/codegen/box/coroutines/kt30858.kt +++ b/compiler/testData/codegen/box/coroutines/kt30858.kt @@ -15,7 +15,7 @@ fun myLaunch( ) {} @OptIn(kotlin.experimental.ExperimentalTypeInference::class) -public fun myProduce(@BuilderInference block: suspend MyProducerScope.() -> Unit) {} +public fun myProduce(block: suspend MyProducerScope.() -> Unit) {} fun MyReceiveChannel.debounce(period: Long) { myProduce { diff --git a/compiler/testData/codegen/box/coroutines/kt31784.kt b/compiler/testData/codegen/box/coroutines/kt31784.kt index 99d6052ba96..f59ab2aebfb 100644 --- a/compiler/testData/codegen/box/coroutines/kt31784.kt +++ b/compiler/testData/codegen/box/coroutines/kt31784.kt @@ -10,7 +10,7 @@ interface Builder { fun filter(filter: (T) -> Boolean) } -fun build(@BuilderInference block: Builder.() -> Unit): T { +fun build(block: Builder.() -> Unit): T { val o = object : Builder { override fun filter(filter: (T) -> Boolean) { diff --git a/compiler/testData/codegen/box/inference/builderInference.kt b/compiler/testData/codegen/box/inference/builderInference.kt index 751bbf7c1a4..7aa87587980 100644 --- a/compiler/testData/codegen/box/inference/builderInference.kt +++ b/compiler/testData/codegen/box/inference/builderInference.kt @@ -21,7 +21,7 @@ interface LiveDataScope { } @OptIn(ExperimentalTypeInference::class) -fun liveData(@BuilderInference block: suspend LiveDataScope.() -> Unit): LiveData = null!! +fun liveData(block: suspend LiveDataScope.() -> Unit): LiveData = null!! fun Flow.asLiveData() = liveData { collect(this::emit) diff --git a/compiler/testData/codegen/box/inference/builderInference/capturedTypes.kt b/compiler/testData/codegen/box/inference/builderInference/capturedTypes.kt index 44e58605af4..ced2a8de15f 100644 --- a/compiler/testData/codegen/box/inference/builderInference/capturedTypes.kt +++ b/compiler/testData/codegen/box/inference/builderInference/capturedTypes.kt @@ -5,10 +5,10 @@ import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit) {} +fun build(block: TestInterface.() -> Unit) {} @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit) {} +fun build2(block: TestInterface.() -> Unit) {} interface TestInterface { fun emit(r: R) diff --git a/compiler/testData/codegen/box/inference/builderInference/commonSuperType.kt b/compiler/testData/codegen/box/inference/builderInference/commonSuperType.kt index 88e3562ff18..bdf6f31f085 100644 --- a/compiler/testData/codegen/box/inference/builderInference/commonSuperType.kt +++ b/compiler/testData/codegen/box/inference/builderInference/commonSuperType.kt @@ -13,10 +13,10 @@ class Test { import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit) {} +fun build(block: TestInterface.() -> Unit) {} @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit) {} +fun build2(block: TestInterface.() -> Unit) {} class Inv diff --git a/compiler/testData/codegen/box/inference/builderInference/commonSuperTypeContravariant.kt b/compiler/testData/codegen/box/inference/builderInference/commonSuperTypeContravariant.kt index 05f7adf6732..0ecad9b8829 100644 --- a/compiler/testData/codegen/box/inference/builderInference/commonSuperTypeContravariant.kt +++ b/compiler/testData/codegen/box/inference/builderInference/commonSuperTypeContravariant.kt @@ -13,10 +13,10 @@ class Test { import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit) {} +fun build(block: TestInterface.() -> Unit) {} @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit) {} +fun build2(block: TestInterface.() -> Unit) {} class In diff --git a/compiler/testData/codegen/box/inference/builderInference/commonSuperTypeCovariant.kt b/compiler/testData/codegen/box/inference/builderInference/commonSuperTypeCovariant.kt index fe8973d3f1c..0bdd03fa593 100644 --- a/compiler/testData/codegen/box/inference/builderInference/commonSuperTypeCovariant.kt +++ b/compiler/testData/codegen/box/inference/builderInference/commonSuperTypeCovariant.kt @@ -14,10 +14,10 @@ class Test { import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit) {} +fun build(block: TestInterface.() -> Unit) {} @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit) {} +fun build2(block: TestInterface.() -> Unit) {} class Out diff --git a/compiler/testData/codegen/box/inference/builderInference/commonSuperTypeInvariant.kt b/compiler/testData/codegen/box/inference/builderInference/commonSuperTypeInvariant.kt index 8dd32a5886e..f67609d8cc5 100644 --- a/compiler/testData/codegen/box/inference/builderInference/commonSuperTypeInvariant.kt +++ b/compiler/testData/codegen/box/inference/builderInference/commonSuperTypeInvariant.kt @@ -14,10 +14,10 @@ class Test { import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit) {} +fun build(block: TestInterface.() -> Unit) {} @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit) {} +fun build2(block: TestInterface.() -> Unit) {} class Inv diff --git a/compiler/testData/codegen/box/inference/builderInference/commonSuperTypeNullable.kt b/compiler/testData/codegen/box/inference/builderInference/commonSuperTypeNullable.kt index 1048062e1b4..3350cbbc290 100644 --- a/compiler/testData/codegen/box/inference/builderInference/commonSuperTypeNullable.kt +++ b/compiler/testData/codegen/box/inference/builderInference/commonSuperTypeNullable.kt @@ -17,10 +17,10 @@ class Test { import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit) {} +fun build(block: TestInterface.() -> Unit) {} @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit) {} +fun build2(block: TestInterface.() -> Unit) {} class Inv diff --git a/compiler/testData/codegen/box/inference/builderInference/constraintsBetweenTwoStubVariables.kt b/compiler/testData/codegen/box/inference/builderInference/constraintsBetweenTwoStubVariables.kt index f953deacdce..8bc279dc581 100644 --- a/compiler/testData/codegen/box/inference/builderInference/constraintsBetweenTwoStubVariables.kt +++ b/compiler/testData/codegen/box/inference/builderInference/constraintsBetweenTwoStubVariables.kt @@ -10,7 +10,7 @@ class Foo(val key: K11) { } @OptIn(ExperimentalTypeInference::class) -fun build(@kotlin.BuilderInference builder: Foo.() -> Unit) {} +fun build(builder: Foo.() -> Unit) {} fun run(x: Int) { build { diff --git a/compiler/testData/codegen/box/inference/builderInference/cstBasedOnTwoBuilderInferenceLambda.kt b/compiler/testData/codegen/box/inference/builderInference/cstBasedOnTwoBuilderInferenceLambda.kt index 9ebb8dce482..b0e136cdad4 100644 --- a/compiler/testData/codegen/box/inference/builderInference/cstBasedOnTwoBuilderInferenceLambda.kt +++ b/compiler/testData/codegen/box/inference/builderInference/cstBasedOnTwoBuilderInferenceLambda.kt @@ -23,22 +23,22 @@ class B: A class C: A @OptIn(ExperimentalTypeInference::class) -fun build1(@BuilderInference builderAction1: In.() -> Unit, @BuilderInference builderAction2: In.() -> Unit): K = 1 as K +fun build1(builderAction1: In.() -> Unit, builderAction2: In.() -> Unit): K = 1 as K @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference builderAction1: In.() -> Unit, @BuilderInference builderAction2: In.() -> Unit): K = B() as K +fun build2(builderAction1: In.() -> Unit, builderAction2: In.() -> Unit): K = B() as K @OptIn(ExperimentalTypeInference::class) -fun build3(@BuilderInference builderAction1: Out.() -> Unit, @BuilderInference builderAction2: Out.() -> Unit): K = 1 as K +fun build3(builderAction1: Out.() -> Unit, builderAction2: Out.() -> Unit): K = 1 as K @OptIn(ExperimentalTypeInference::class) -fun build4(@BuilderInference builderAction1: Out.() -> Unit, @BuilderInference builderAction2: Out.() -> Unit): K = B() as K +fun build4(builderAction1: Out.() -> Unit, builderAction2: Out.() -> Unit): K = B() as K @OptIn(ExperimentalTypeInference::class) -fun build5(@BuilderInference builderAction1: Inv.() -> Unit, @BuilderInference builderAction2: Inv.() -> Unit): K = 1 as K +fun build5(builderAction1: Inv.() -> Unit, builderAction2: Inv.() -> Unit): K = 1 as K @OptIn(ExperimentalTypeInference::class) -fun build6(@BuilderInference builderAction1: Inv.() -> Unit, @BuilderInference builderAction2: Inv.() -> Unit): K = B() as K +fun build6(builderAction1: Inv.() -> Unit, builderAction2: Inv.() -> Unit): K = B() as K @OptIn(ExperimentalStdlibApi::class) fun box(): String { diff --git a/compiler/testData/codegen/box/inference/builderInference/intersect.kt b/compiler/testData/codegen/box/inference/builderInference/intersect.kt index a3631c6e115..1ecab396562 100644 --- a/compiler/testData/codegen/box/inference/builderInference/intersect.kt +++ b/compiler/testData/codegen/box/inference/builderInference/intersect.kt @@ -13,10 +13,10 @@ class Test { import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit) {} +fun build(block: TestInterface.() -> Unit) {} @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit) {} +fun build2(block: TestInterface.() -> Unit) {} class In diff --git a/compiler/testData/codegen/box/inference/builderInference/kt41164.kt b/compiler/testData/codegen/box/inference/builderInference/kt41164.kt index 3333a02a96a..d7aa69ba9f5 100644 --- a/compiler/testData/codegen/box/inference/builderInference/kt41164.kt +++ b/compiler/testData/codegen/box/inference/builderInference/kt41164.kt @@ -8,7 +8,7 @@ interface MyFlow fun select(x: K, y: K): K = x @OptIn(ExperimentalTypeInference::class) -fun myCallbackFlow(@BuilderInference block: MyProducerScope.() -> Unit): MyFlow = null!! +fun myCallbackFlow(block: MyProducerScope.() -> Unit): MyFlow = null!! fun MyProducerScope<*>.myAwaitClose(block: () -> Unit = {}) {} fun myEmptyFlow(): MyFlow = null!! diff --git a/compiler/testData/codegen/box/inference/builderInference/kt44241.kt b/compiler/testData/codegen/box/inference/builderInference/kt44241.kt index e1216f9f6f6..f294a699d0c 100644 --- a/compiler/testData/codegen/box/inference/builderInference/kt44241.kt +++ b/compiler/testData/codegen/box/inference/builderInference/kt44241.kt @@ -11,7 +11,7 @@ class Scope( } @OptIn(ExperimentalTypeInference::class) -fun B.scoped(@kotlin.BuilderInference binder: Scope.() -> Unit) {} +fun B.scoped(binder: Scope.() -> Unit) {} fun run(x: B) { x.scoped { emit(key) } diff --git a/compiler/testData/codegen/box/inference/builderInference/kt45083.kt b/compiler/testData/codegen/box/inference/builderInference/kt45083.kt index 9c3aead8b3a..55c8338f08c 100644 --- a/compiler/testData/codegen/box/inference/builderInference/kt45083.kt +++ b/compiler/testData/codegen/box/inference/builderInference/kt45083.kt @@ -6,7 +6,7 @@ object Hello { } @OptIn(ExperimentalTypeInference::class) -fun buildList0(@BuilderInference builder: MutableList.() -> Unit): List = mutableListOf().apply { builder() } +fun buildList0(builder: MutableList.() -> Unit): List = mutableListOf().apply { builder() } val numbers = buildList0 { add(Hello.let { it::hello }.get()) diff --git a/compiler/testData/codegen/box/inference/builderInference/kt47744.kt b/compiler/testData/codegen/box/inference/builderInference/kt47744.kt index e9c246bfe15..1cbd71bd87c 100644 --- a/compiler/testData/codegen/box/inference/builderInference/kt47744.kt +++ b/compiler/testData/codegen/box/inference/builderInference/kt47744.kt @@ -4,10 +4,10 @@ import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit) = Flow() +fun flow(block: suspend FlowCollector.() -> Unit) = Flow() @OptIn(ExperimentalTypeInference::class) -fun produce(@BuilderInference block: suspend SendChannel.() -> Unit) {} +fun produce(block: suspend SendChannel.() -> Unit) {} interface SendChannel { val onSend: SelectClause2> diff --git a/compiler/testData/codegen/box/inference/builderInference/kt51988.kt b/compiler/testData/codegen/box/inference/builderInference/kt51988.kt index 1d37a53f45e..cf3af2230b9 100644 --- a/compiler/testData/codegen/box/inference/builderInference/kt51988.kt +++ b/compiler/testData/codegen/box/inference/builderInference/kt51988.kt @@ -3,12 +3,12 @@ import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: BuilderScope.() -> BB1): ResultProvider = object : ResultProvider { +fun build(block: BuilderScope.() -> BB1): ResultProvider = object : ResultProvider { override fun provideResult(): AB1 = "OK" as AB1 } @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: BuilderScope.() -> BB2): ResultProvider = object : ResultProvider { +fun build2(block: BuilderScope.() -> BB2): ResultProvider = object : ResultProvider { override fun provideResult(): AB2 = "OK" as AB2 } diff --git a/compiler/testData/codegen/box/inference/builderInference/labaledCall.kt b/compiler/testData/codegen/box/inference/builderInference/labaledCall.kt index 219006735d2..5b69f23c302 100644 --- a/compiler/testData/codegen/box/inference/builderInference/labaledCall.kt +++ b/compiler/testData/codegen/box/inference/builderInference/labaledCall.kt @@ -5,7 +5,7 @@ import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit) {} +fun build(block: TestInterface.() -> Unit) {} interface TestInterface { fun emit(r: R) diff --git a/compiler/testData/codegen/box/inference/builderInference/lackOfNullCheckOnNullableInsideBuild.kt b/compiler/testData/codegen/box/inference/builderInference/lackOfNullCheckOnNullableInsideBuild.kt index 3b432b05fe9..af699325246 100644 --- a/compiler/testData/codegen/box/inference/builderInference/lackOfNullCheckOnNullableInsideBuild.kt +++ b/compiler/testData/codegen/box/inference/builderInference/lackOfNullCheckOnNullableInsideBuild.kt @@ -15,7 +15,7 @@ class Builder { } @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference configure: Builder.() -> Unit) = +fun build(configure: Builder.() -> Unit) = Builder().apply(configure).build() fun box(): String { diff --git a/compiler/testData/codegen/box/inference/builderInference/memberScope.kt b/compiler/testData/codegen/box/inference/builderInference/memberScope.kt index e569bdd35a3..42d2b17b909 100644 --- a/compiler/testData/codegen/box/inference/builderInference/memberScope.kt +++ b/compiler/testData/codegen/box/inference/builderInference/memberScope.kt @@ -11,7 +11,7 @@ interface TestInterface { } @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit) {} +fun build(block: TestInterface.() -> Unit) {} fun Any.test() {} fun Any?.test2() {} diff --git a/compiler/testData/codegen/box/inference/builderInference/nullability.kt b/compiler/testData/codegen/box/inference/builderInference/nullability.kt index aee5f8cb73d..8c4acb36657 100644 --- a/compiler/testData/codegen/box/inference/builderInference/nullability.kt +++ b/compiler/testData/codegen/box/inference/builderInference/nullability.kt @@ -11,16 +11,16 @@ interface TestInterface { } @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit) {} +fun build(block: TestInterface.() -> Unit) {} @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit) {} +fun build2(block: TestInterface.() -> Unit) {} @OptIn(ExperimentalTypeInference::class) -fun build3(@BuilderInference block: TestInterface.() -> Unit) {} +fun build3(block: TestInterface.() -> Unit) {} @OptIn(ExperimentalTypeInference::class) -fun build4(x: R2, @BuilderInference block: TestInterface.() -> Unit) {} +fun build4(x: R2, block: TestInterface.() -> Unit) {} fun test(a: String?) { val ret1 = build { diff --git a/compiler/testData/codegen/box/inference/builderInference/propagateInferenceSessionIntoDeclarationAnalyzers.kt b/compiler/testData/codegen/box/inference/builderInference/propagateInferenceSessionIntoDeclarationAnalyzers.kt index 92a9a0b04df..e6cff063587 100644 --- a/compiler/testData/codegen/box/inference/builderInference/propagateInferenceSessionIntoDeclarationAnalyzers.kt +++ b/compiler/testData/codegen/box/inference/builderInference/propagateInferenceSessionIntoDeclarationAnalyzers.kt @@ -18,7 +18,7 @@ public interface ProducerScopeX { public class FlowX {} @OptIn(ExperimentalTypeInference::class) -public fun callbackFlowX(@BuilderInference block: ProducerScopeX.() -> Unit): FlowX = FlowX() +public fun callbackFlowX(block: ProducerScopeX.() -> Unit): FlowX = FlowX() fun foo(): FlowX = callbackFlowX { object : Callback { diff --git a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferences.kt b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferences.kt index fc3ed5da452..054b109ac03 100644 --- a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferences.kt +++ b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferences.kt @@ -14,7 +14,7 @@ fun materialize() = null as T interface FlowCollector {} @Suppress("OPT_IN_USAGE_ERROR") -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit) = Flow(block) +fun flow(block: suspend FlowCollector.() -> Unit) = Flow(block) class Flow(private val block: suspend FlowCollector.() -> Unit) diff --git a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt index 5ba5719c430..58db624500d 100644 --- a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt +++ b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt @@ -31,7 +31,7 @@ fun foo7() = null as Foo7 interface FlowCollector {} @OptIn(ExperimentalTypeInference::class) -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit) = Flow(block) +fun flow(block: suspend FlowCollector.() -> Unit) = Flow(block) class Flow(private val block: suspend FlowCollector.() -> Unit) diff --git a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt index fc3ed5da452..054b109ac03 100644 --- a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt +++ b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt @@ -14,7 +14,7 @@ fun materialize() = null as T interface FlowCollector {} @Suppress("OPT_IN_USAGE_ERROR") -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit) = Flow(block) +fun flow(block: suspend FlowCollector.() -> Unit) = Flow(block) class Flow(private val block: suspend FlowCollector.() -> Unit) diff --git a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt index 77c092f0aed..fc77015f26f 100644 --- a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt +++ b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt @@ -6,17 +6,17 @@ import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun scopedFlow(@BuilderInference block: suspend CoroutineScope.(FlowCollector) -> Unit): Flow = +fun scopedFlow(block: suspend CoroutineScope.(FlowCollector) -> Unit): Flow = flow { val collector = this flowScope { block(collector) } } @OptIn(ExperimentalTypeInference::class) -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit): Flow = TODO() +fun flow(block: suspend FlowCollector.() -> Unit): Flow = TODO() @OptIn(ExperimentalTypeInference::class) -fun flowScope(@BuilderInference block: suspend CoroutineScope.() -> R): R = TODO() +fun flowScope(block: suspend CoroutineScope.() -> R): R = TODO() interface CoroutineScope interface Flow diff --git a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithLambdas.kt b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithLambdas.kt index c7c5879143a..2285bc281cd 100644 --- a/compiler/testData/codegen/box/inference/builderInference/specialCallsWithLambdas.kt +++ b/compiler/testData/codegen/box/inference/builderInference/specialCallsWithLambdas.kt @@ -5,7 +5,7 @@ import kotlin.experimental.ExperimentalTypeInference interface FlowCollector {} @Suppress("OPT_IN_USAGE_ERROR") -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit) = Flow(block) +fun flow(block: suspend FlowCollector.() -> Unit) = Flow(block) class Flow(private val block: suspend FlowCollector.() -> Unit) diff --git a/compiler/testData/codegen/box/inference/builderInference/substituteStubTypeIntolambdaParameterDescriptor.kt b/compiler/testData/codegen/box/inference/builderInference/substituteStubTypeIntolambdaParameterDescriptor.kt index 18429800371..f877f5014d0 100644 --- a/compiler/testData/codegen/box/inference/builderInference/substituteStubTypeIntolambdaParameterDescriptor.kt +++ b/compiler/testData/codegen/box/inference/builderInference/substituteStubTypeIntolambdaParameterDescriptor.kt @@ -8,7 +8,7 @@ class TypeDefinition { } @OptIn(ExperimentalTypeInference::class) -fun defineType(@BuilderInference definition: TypeDefinition.() -> Unit): Unit {} +fun defineType(definition: TypeDefinition.() -> Unit): Unit {} fun test() { defineType { diff --git a/compiler/testData/codegen/box/inference/builderInference/substituteTypeVariableIntolambdaParameterDescriptor.kt b/compiler/testData/codegen/box/inference/builderInference/substituteTypeVariableIntolambdaParameterDescriptor.kt index de3547dac23..80a632a96ff 100644 --- a/compiler/testData/codegen/box/inference/builderInference/substituteTypeVariableIntolambdaParameterDescriptor.kt +++ b/compiler/testData/codegen/box/inference/builderInference/substituteTypeVariableIntolambdaParameterDescriptor.kt @@ -12,7 +12,7 @@ interface FlowCollector { } @Suppress("OPT_IN_USAGE_ERROR") -fun flow(@BuilderInference block: FlowCollector.() -> Unit): I = null as I +fun flow(block: FlowCollector.() -> Unit): I = null as I fun adapt(): Unit = flow { emit(foo { coroutine -> bar(coroutine) }) diff --git a/compiler/testData/codegen/box/inference/builderInference/substitutelambdaExtensionReceiverType.kt b/compiler/testData/codegen/box/inference/builderInference/substitutelambdaExtensionReceiverType.kt index c12d593f6a6..3aae4afa83b 100644 --- a/compiler/testData/codegen/box/inference/builderInference/substitutelambdaExtensionReceiverType.kt +++ b/compiler/testData/codegen/box/inference/builderInference/substitutelambdaExtensionReceiverType.kt @@ -6,7 +6,7 @@ operator fun SequenceScope.plusAssign(x: SequenceScope) {} @OptIn(ExperimentalTypeInference::class) -fun mySequence(@BuilderInference block: suspend SequenceScope.() -> Unit): Sequence = Sequence { iterator(block) } +fun mySequence(block: suspend SequenceScope.() -> Unit): Sequence = Sequence { iterator(block) } fun main() { val y: Sequence = mySequence { diff --git a/compiler/testData/codegen/box/inference/builderInference/topDownCompletionBreakedByNonBuilderInferenceSession.kt b/compiler/testData/codegen/box/inference/builderInference/topDownCompletionBreakedByNonBuilderInferenceSession.kt index ade47900065..be80d840864 100644 --- a/compiler/testData/codegen/box/inference/builderInference/topDownCompletionBreakedByNonBuilderInferenceSession.kt +++ b/compiler/testData/codegen/box/inference/builderInference/topDownCompletionBreakedByNonBuilderInferenceSession.kt @@ -5,17 +5,17 @@ import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) class A1 { - fun builder1(@BuilderInference configure: A2.() -> Unit) {} + fun builder1(configure: A2.() -> Unit) {} } @OptIn(ExperimentalTypeInference::class) class A2 { - fun builder2(@BuilderInference configure: A3.() -> Unit) {} + fun builder2(configure: A3.() -> Unit) {} } @OptIn(ExperimentalTypeInference::class) class A3 { - fun builder3(@BuilderInference configure: A4.() -> Unit) {} + fun builder3(configure: A4.() -> Unit) {} } class A4 { diff --git a/compiler/testData/codegen/box/inference/builderInference/topDownCompletionWithThreeBuilderInferenceCalls.kt b/compiler/testData/codegen/box/inference/builderInference/topDownCompletionWithThreeBuilderInferenceCalls.kt index 727ad0f7094..8f8fd8d47b1 100644 --- a/compiler/testData/codegen/box/inference/builderInference/topDownCompletionWithThreeBuilderInferenceCalls.kt +++ b/compiler/testData/codegen/box/inference/builderInference/topDownCompletionWithThreeBuilderInferenceCalls.kt @@ -5,17 +5,17 @@ import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) class A1 { - fun builder1(@BuilderInference configure: A2.() -> Unit) {} + fun builder1(configure: A2.() -> Unit) {} } @OptIn(ExperimentalTypeInference::class) class A2 { - fun builder2(@BuilderInference configure: A3.() -> Unit) {} + fun builder2(configure: A3.() -> Unit) {} } @OptIn(ExperimentalTypeInference::class) class A3 { - fun builder3(@BuilderInference configure: A4.() -> Unit) {} + fun builder3(configure: A4.() -> Unit) {} } class A4 { diff --git a/compiler/testData/codegen/box/inference/builderInference/topDownCompletionWithThreeBuilderInferenceCallsSameLevel.kt b/compiler/testData/codegen/box/inference/builderInference/topDownCompletionWithThreeBuilderInferenceCallsSameLevel.kt index f9aac31418e..e1d6e6fdb61 100644 --- a/compiler/testData/codegen/box/inference/builderInference/topDownCompletionWithThreeBuilderInferenceCallsSameLevel.kt +++ b/compiler/testData/codegen/box/inference/builderInference/topDownCompletionWithThreeBuilderInferenceCallsSameLevel.kt @@ -5,17 +5,17 @@ import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) class A1 { - fun builder1(@BuilderInference configure: A2.() -> Unit) {} + fun builder1(configure: A2.() -> Unit) {} } @OptIn(ExperimentalTypeInference::class) class A2 { - fun builder2(@BuilderInference configure: A3.() -> Unit) {} + fun builder2(configure: A3.() -> Unit) {} } @OptIn(ExperimentalTypeInference::class) class A3 { - fun builder3(@BuilderInference configure: A4.() -> Unit) {} + fun builder3(configure: A4.() -> Unit) {} } class A4 { diff --git a/compiler/testData/codegen/box/inference/builderInference/topDownCompletionWithTwoBuilderInferenceCalls.kt b/compiler/testData/codegen/box/inference/builderInference/topDownCompletionWithTwoBuilderInferenceCalls.kt index 3202323ccef..2c633dbc4c6 100644 --- a/compiler/testData/codegen/box/inference/builderInference/topDownCompletionWithTwoBuilderInferenceCalls.kt +++ b/compiler/testData/codegen/box/inference/builderInference/topDownCompletionWithTwoBuilderInferenceCalls.kt @@ -5,12 +5,12 @@ import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) class A1 { - fun builder1(@BuilderInference configure: A2.() -> Unit) {} + fun builder1(configure: A2.() -> Unit) {} } @OptIn(ExperimentalTypeInference::class) class A2 { - fun builder2(@BuilderInference configure: A3.() -> Unit) {} + fun builder2(configure: A3.() -> Unit) {} } class A3 { diff --git a/compiler/testData/codegen/box/inference/builderInferenceLeakingVariable.kt b/compiler/testData/codegen/box/inference/builderInferenceLeakingVariable.kt index ec472f2787e..7c395a6d68c 100644 --- a/compiler/testData/codegen/box/inference/builderInferenceLeakingVariable.kt +++ b/compiler/testData/codegen/box/inference/builderInferenceLeakingVariable.kt @@ -12,7 +12,7 @@ class InImpl(val block: suspend In.() -> Unit) : In { } @OptIn(ExperimentalTypeInference::class) -public fun builder(@BuilderInference block: suspend In.() -> Unit) { +public fun builder(block: suspend In.() -> Unit) { InImpl(block) } diff --git a/compiler/testData/codegen/box/inference/builderInferenceWithAnnotation.kt b/compiler/testData/codegen/box/inference/builderInferenceWithAnnotation.kt new file mode 100644 index 00000000000..751bbf7c1a4 --- /dev/null +++ b/compiler/testData/codegen/box/inference/builderInferenceWithAnnotation.kt @@ -0,0 +1,31 @@ +// TARGET_BACKEND: JVM +// WITH_STDLIB +// ISSUE: KT-33545 + +import kotlin.experimental.ExperimentalTypeInference + +interface Flow { + suspend fun collect(collector: FlowCollector) +} + +interface FlowCollector { + suspend fun emit(value: T) +} + +inline fun Flow.collect(crossinline action: suspend (value: T) -> Unit): Unit {} + +abstract class LiveData + +interface LiveDataScope { + suspend fun emit(value: T) +} + +@OptIn(ExperimentalTypeInference::class) +fun liveData(@BuilderInference block: suspend LiveDataScope.() -> Unit): LiveData = null!! + +fun Flow.asLiveData() = liveData { + collect(this::emit) +// collect { emit(it) } +} + +fun box(): String = "OK" diff --git a/compiler/testData/codegen/box/inference/kt35684.kt b/compiler/testData/codegen/box/inference/kt35684.kt index 7cce32de092..da78e489a73 100644 --- a/compiler/testData/codegen/box/inference/kt35684.kt +++ b/compiler/testData/codegen/box/inference/kt35684.kt @@ -13,7 +13,7 @@ fun test() { } @OptIn(ExperimentalTypeInference::class) -fun sequence(@BuilderInference block: suspend Inv.() -> Unit) {} +fun sequence(block: suspend Inv.() -> Unit) {} interface Inv { fun yield(element: T) diff --git a/compiler/testData/codegen/box/inference/kt36446.kt b/compiler/testData/codegen/box/inference/kt36446.kt index bd83fe1b872..8eaa6aaccd2 100644 --- a/compiler/testData/codegen/box/inference/kt36446.kt +++ b/compiler/testData/codegen/box/inference/kt36446.kt @@ -28,7 +28,7 @@ class ConversionBuilder { } class DefinitionBuilder { @OptIn(ExperimentalTypeInference::class) - fun conversion(@BuilderInference configure: ConversionBuilder.() -> Unit): Unit {} + fun conversion(configure: ConversionBuilder.() -> Unit): Unit {} } interface ArgumentDefinition { operator fun provideDelegate(thisRef: Any?, property: KProperty<*>): ArgumentReference diff --git a/compiler/testData/codegen/box/inference/mapCollectChainWithNullResult.kt b/compiler/testData/codegen/box/inference/mapCollectChainWithNullResult.kt index 595171ad577..08165c41b88 100644 --- a/compiler/testData/codegen/box/inference/mapCollectChainWithNullResult.kt +++ b/compiler/testData/codegen/box/inference/mapCollectChainWithNullResult.kt @@ -20,7 +20,7 @@ fun Flow.collect(action: (value: T) -> Unit): Unit = override fun emit(value: T) = action(value) }) -fun Flow.transform(@BuilderInference transform: FlowCollector.(T) -> Unit): Flow = +fun Flow.transform(transform: FlowCollector.(T) -> Unit): Flow = flow { collect { transform(it) } } fun Flow.map(transform: (T) -> R): Flow = diff --git a/compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt b/compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt index a5a2dea6921..52ad82ed5fa 100644 --- a/compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt +++ b/compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt @@ -7,7 +7,7 @@ interface SendChannel { } @OptIn(ExperimentalTypeInference::class) -public fun flux(@BuilderInference block: suspend SendChannel.() -> Unit) {} +public fun flux(block: suspend SendChannel.() -> Unit) {} suspend inline fun T.collect(action: (T) -> Unit) { action(this) } diff --git a/compiler/testData/codegen/bytecodeListing/coroutines/spilling/select.kt b/compiler/testData/codegen/bytecodeListing/coroutines/spilling/select.kt index 9ff886db1ee..23552fcce90 100644 --- a/compiler/testData/codegen/bytecodeListing/coroutines/spilling/select.kt +++ b/compiler/testData/codegen/bytecodeListing/coroutines/spilling/select.kt @@ -8,7 +8,7 @@ interface CoroutineScope @OptIn(ExperimentalTypeInference::class) public fun CoroutineScope.produce( - @BuilderInference block: suspend ProducerScope.() -> Unit + block: suspend ProducerScope.() -> Unit ): ReceiveChannel = TODO() interface ProducerScope : CoroutineScope, SendChannel { diff --git a/compiler/testData/codegen/bytecodeListing/coroutines/spilling/select.txt b/compiler/testData/codegen/bytecodeListing/coroutines/spilling/select.txt index 5551c9fd8ea..aa8a6da4920 100644 --- a/compiler/testData/codegen/bytecodeListing/coroutines/spilling/select.txt +++ b/compiler/testData/codegen/bytecodeListing/coroutines/spilling/select.txt @@ -56,7 +56,7 @@ final class SelectKt$produceNumbers$1 { public final class SelectKt { // source: 'select.kt' inner (anonymous) class SelectKt$produceNumbers$1 - public final static @org.jetbrains.annotations.NotNull method produce(@org.jetbrains.annotations.NotNull p0: CoroutineScope, @kotlin.BuilderInference @org.jetbrains.annotations.NotNull p1: kotlin.jvm.functions.Function2): ReceiveChannel + public final static @org.jetbrains.annotations.NotNull method produce(@org.jetbrains.annotations.NotNull p0: CoroutineScope, @org.jetbrains.annotations.NotNull p1: kotlin.jvm.functions.Function2): ReceiveChannel public final static @org.jetbrains.annotations.NotNull method produceNumbers(@org.jetbrains.annotations.NotNull p0: CoroutineScope, @org.jetbrains.annotations.NotNull p1: SendChannel): ReceiveChannel private final static @org.jetbrains.annotations.Nullable method select$$forInline(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object public final static @org.jetbrains.annotations.Nullable method select(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object diff --git a/compiler/testData/codegen/bytecodeText/coroutines/debug/localVariableCorrectLabel.kt b/compiler/testData/codegen/bytecodeText/coroutines/debug/localVariableCorrectLabel.kt index 08be3e69140..6ddcd892ad3 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/debug/localVariableCorrectLabel.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/debug/localVariableCorrectLabel.kt @@ -11,7 +11,6 @@ fun main(args: Array) { } @OptIn(ExperimentalTypeInference::class) -@BuilderInference suspend fun SequenceScope.awaitSeq(): Int = 42 // JVM_IR_TEMPLATES diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/changingResolveIfDontUseBuilderInference.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/changingResolveIfDontUseBuilderInference.fir.kt index 0b0a0ac938d..c12c2dd76ab 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/changingResolveIfDontUseBuilderInference.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/changingResolveIfDontUseBuilderInference.fir.kt @@ -5,14 +5,14 @@ import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun buildMap(@BuilderInference builderAction: MutableMap.() -> Unit): Map = mapOf() +fun buildMap(builderAction: MutableMap.() -> Unit): Map = mapOf() fun foo(): MutableMap = mutableMapOf() fun MutableMap.swap(x: MutableMap) {} @OptIn(ExperimentalTypeInference::class) -fun build7(@BuilderInference builderAction: MutableMap.() -> MutableMap) = mutableMapOf() +fun build7(builderAction: MutableMap.() -> MutableMap) = mutableMapOf() fun id(x: K): K = x diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/changingResolveIfDontUseBuilderInference.kt b/compiler/testData/diagnostics/tests/inference/builderInference/changingResolveIfDontUseBuilderInference.kt index 0ec13a22265..137e9dac5db 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/changingResolveIfDontUseBuilderInference.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/changingResolveIfDontUseBuilderInference.kt @@ -5,14 +5,14 @@ import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun buildMap(@BuilderInference builderAction: MutableMap.() -> Unit): Map = mapOf() +fun buildMap(builderAction: MutableMap.() -> Unit): Map = mapOf() fun foo(): MutableMap = mutableMapOf() fun MutableMap.swap(x: MutableMap) {} @OptIn(ExperimentalTypeInference::class) -fun build7(@BuilderInference builderAction: MutableMap.() -> MutableMap) = mutableMapOf() +fun build7(builderAction: MutableMap.() -> MutableMap) = mutableMapOf() fun id(x: K): K = x diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/changingResolveIfDontUseBuilderInference.txt b/compiler/testData/diagnostics/tests/inference/builderInference/changingResolveIfDontUseBuilderInference.txt index 169138939d9..e90e72cd08f 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/changingResolveIfDontUseBuilderInference.txt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/changingResolveIfDontUseBuilderInference.txt @@ -1,7 +1,7 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build7(/*0*/ @kotlin.BuilderInference builderAction: kotlin.collections.MutableMap.() -> kotlin.collections.MutableMap): kotlin.collections.MutableMap -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun buildMap(/*0*/ @kotlin.BuilderInference builderAction: kotlin.collections.MutableMap.() -> kotlin.Unit): kotlin.collections.Map +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build7(/*0*/ builderAction: kotlin.collections.MutableMap.() -> kotlin.collections.MutableMap): kotlin.collections.MutableMap +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun buildMap(/*0*/ builderAction: kotlin.collections.MutableMap.() -> kotlin.Unit): kotlin.collections.Map public fun foo(): kotlin.collections.MutableMap public fun id(/*0*/ x: K): K @kotlin.OptIn(markerClass = {kotlin.ExperimentalStdlibApi::class}) public fun main(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/kt47744.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/kt47744.fir.kt index 3e7b0a524c2..0baf68042a2 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/kt47744.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/kt47744.fir.kt @@ -5,10 +5,10 @@ import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit) = Flow() +fun flow(block: suspend FlowCollector.() -> Unit) = Flow() @OptIn(ExperimentalTypeInference::class) -fun produce(@BuilderInference block: suspend SendChannel.() -> Unit) {} +fun produce(block: suspend SendChannel.() -> Unit) {} interface SendChannel { val onSend: SelectClause2> diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/kt47744.kt b/compiler/testData/diagnostics/tests/inference/builderInference/kt47744.kt index eb50e45ff7b..0a38fa319ea 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/kt47744.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/kt47744.kt @@ -5,10 +5,10 @@ import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit) = Flow() +fun flow(block: suspend FlowCollector.() -> Unit) = Flow() @OptIn(ExperimentalTypeInference::class) -fun produce(@BuilderInference block: suspend SendChannel.() -> Unit) {} +fun produce(block: suspend SendChannel.() -> Unit) {} interface SendChannel { val onSend: SelectClause2> diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/kt47744.txt b/compiler/testData/diagnostics/tests/inference/builderInference/kt47744.txt index 5909d027a0d..7dd968e1832 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/kt47744.txt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/kt47744.txt @@ -1,7 +1,7 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun flow(/*0*/ @kotlin.BuilderInference block: suspend FlowCollector.() -> kotlin.Unit): Flow -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun produce(/*0*/ @kotlin.BuilderInference block: suspend SendChannel.() -> kotlin.Unit): kotlin.Unit +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun flow(/*0*/ block: suspend FlowCollector.() -> kotlin.Unit): Flow +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun produce(/*0*/ block: suspend SendChannel.() -> kotlin.Unit): kotlin.Unit public inline fun select(/*0*/ crossinline builder: SelectBuilder.() -> kotlin.Unit): R public fun test(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/kt49285.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/kt49285.fir.kt index eeb0138025a..2cedb771bdf 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/kt49285.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/kt49285.fir.kt @@ -7,10 +7,10 @@ class Foo { } @OptIn(ExperimentalTypeInference::class) -fun myBuilder1(@BuilderInference builder: Foo.() -> Foo): Foo = Foo().apply { builder() } +fun myBuilder1(builder: Foo.() -> Foo): Foo = Foo().apply { builder() } @OptIn(ExperimentalTypeInference::class) -fun myBuilder2(@BuilderInference builder: Foo.() -> Unit): Foo = Foo().apply(builder) +fun myBuilder2(builder: Foo.() -> Unit): Foo = Foo().apply(builder) val result1 = myBuilder1 { add(null) diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/kt49285.kt b/compiler/testData/diagnostics/tests/inference/builderInference/kt49285.kt index 8ed2993dd6b..a44869a9145 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/kt49285.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/kt49285.kt @@ -7,10 +7,10 @@ class Foo { } @OptIn(ExperimentalTypeInference::class) -fun myBuilder1(@BuilderInference builder: Foo.() -> Foo): Foo = Foo().apply { builder() } +fun myBuilder1(builder: Foo.() -> Foo): Foo = Foo().apply { builder() } @OptIn(ExperimentalTypeInference::class) -fun myBuilder2(@BuilderInference builder: Foo.() -> Unit): Foo = Foo().apply(builder) +fun myBuilder2(builder: Foo.() -> Unit): Foo = Foo().apply(builder) val result1 = myBuilder1 { add(null) diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/kt49285.txt b/compiler/testData/diagnostics/tests/inference/builderInference/kt49285.txt index 3761e785835..f5eacf58c32 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/kt49285.txt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/kt49285.txt @@ -1,8 +1,8 @@ package public val result1: Foo -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun myBuilder1(/*0*/ @kotlin.BuilderInference builder: Foo.() -> Foo): Foo -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun myBuilder2(/*0*/ @kotlin.BuilderInference builder: Foo.() -> kotlin.Unit): Foo +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun myBuilder1(/*0*/ builder: Foo.() -> Foo): Foo +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun myBuilder2(/*0*/ builder: Foo.() -> kotlin.Unit): Foo public final class Foo { public constructor Foo() diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/kt49828.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/kt49828.fir.kt index faad5dd9fee..3edd24a0e44 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/kt49828.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/kt49828.fir.kt @@ -201,7 +201,7 @@ interface Foo2 { fun entries(): MutableSet> } -fun twoBuilderLambdas(@BuilderInference block: Foo.() -> Unit, @BuilderInference block2: Foo2.() -> Unit) {} +fun twoBuilderLambdas(block: Foo.() -> Unit, block2: Foo2.() -> Unit) {} fun test() { twoBuilderLambdas( diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/kt49828.kt b/compiler/testData/diagnostics/tests/inference/builderInference/kt49828.kt index 4ed8dd2e8ac..67364b1a5bf 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/kt49828.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/kt49828.kt @@ -201,7 +201,7 @@ interface Foo2 { fun entries(): MutableSet> } -fun twoBuilderLambdas(@BuilderInference block: Foo.() -> Unit, @BuilderInference block2: Foo2.() -> Unit) {} +fun twoBuilderLambdas(block: Foo.() -> Unit, block2: Foo2.() -> Unit) {} fun test() { twoBuilderLambdas( @@ -209,13 +209,13 @@ fun test() { add("") with (get()) { with (listOf(1)) { - bar() + bar() } } }, { put(1, "one") - foo11(>; K, V; Int, String")!>entries()) + foo11(entries()) } ) } diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/kt49828.txt b/compiler/testData/diagnostics/tests/inference/builderInference/kt49828.txt index 6fe2cd86100..1ea391c302c 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/kt49828.txt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/kt49828.txt @@ -19,7 +19,7 @@ public fun foo11(/*0*/ x: kotlin.collections.MutableSet>): kotlin.Unit public fun main(): kotlin.Unit public fun test(): kotlin.Unit -public fun twoBuilderLambdas(/*0*/ @kotlin.BuilderInference block: Foo.() -> kotlin.Unit, /*1*/ @kotlin.BuilderInference block2: Foo2.() -> kotlin.Unit): kotlin.Unit +public fun twoBuilderLambdas(/*0*/ block: Foo.() -> kotlin.Unit, /*1*/ block2: Foo2.() -> 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 diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/labaledCall.kt b/compiler/testData/diagnostics/tests/inference/builderInference/labaledCall.kt index 654e732240c..c2a61b56e8d 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/labaledCall.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/labaledCall.kt @@ -6,7 +6,7 @@ import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit): R = TODO() +fun build(block: TestInterface.() -> Unit): R = TODO() interface TestInterface { fun emit(r: R) diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/labaledCall.txt b/compiler/testData/diagnostics/tests/inference/builderInference/labaledCall.txt index 39ea44b5681..a3c60bbbf8a 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/labaledCall.txt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/labaledCall.txt @@ -1,6 +1,6 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ @kotlin.BuilderInference block: TestInterface.() -> kotlin.Unit): R +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ block: TestInterface.() -> kotlin.Unit): R public fun main(): kotlin.Unit public interface TestInterface { diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/simpleLambdaInCallWithAnotherLambdaWithBuilderInference.kt b/compiler/testData/diagnostics/tests/inference/builderInference/simpleLambdaInCallWithAnotherLambdaWithBuilderInference.kt index 2359743985f..4b30798bdcc 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/simpleLambdaInCallWithAnotherLambdaWithBuilderInference.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/simpleLambdaInCallWithAnotherLambdaWithBuilderInference.kt @@ -7,7 +7,7 @@ import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) fun combined( check: () -> Unit, - @BuilderInference block: TestInterface.() -> Unit + block: TestInterface.() -> Unit ): R = TODO() interface TestInterface { diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/simpleLambdaInCallWithAnotherLambdaWithBuilderInference.txt b/compiler/testData/diagnostics/tests/inference/builderInference/simpleLambdaInCallWithAnotherLambdaWithBuilderInference.txt index ec07844fd2f..e56a038d7e6 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/simpleLambdaInCallWithAnotherLambdaWithBuilderInference.txt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/simpleLambdaInCallWithAnotherLambdaWithBuilderInference.txt @@ -1,6 +1,6 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun combined(/*0*/ check: () -> kotlin.Unit, /*1*/ @kotlin.BuilderInference block: TestInterface.() -> kotlin.Unit): R +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun combined(/*0*/ check: () -> kotlin.Unit, /*1*/ block: TestInterface.() -> kotlin.Unit): R public fun test(): kotlin.Unit public interface TestInterface { diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/skipedUnresolvedInBuilderInferenceWithStubReceiverType.kt b/compiler/testData/diagnostics/tests/inference/builderInference/skipedUnresolvedInBuilderInferenceWithStubReceiverType.kt index 45f67e5cb28..264457e50bd 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/skipedUnresolvedInBuilderInferenceWithStubReceiverType.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/skipedUnresolvedInBuilderInferenceWithStubReceiverType.kt @@ -5,7 +5,7 @@ import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun foo(x: T, @BuilderInference builder: T.() -> Unit): Unit = TODO() +fun foo(x: T, builder: T.() -> Unit): Unit = TODO() class Bar diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/skipedUnresolvedInBuilderInferenceWithStubReceiverType.txt b/compiler/testData/diagnostics/tests/inference/builderInference/skipedUnresolvedInBuilderInferenceWithStubReceiverType.txt index b0b700c7316..3bee519b086 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/skipedUnresolvedInBuilderInferenceWithStubReceiverType.txt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/skipedUnresolvedInBuilderInferenceWithStubReceiverType.txt @@ -1,6 +1,6 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun foo(/*0*/ x: T, /*1*/ @kotlin.BuilderInference builder: T.() -> kotlin.Unit): kotlin.Unit +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun foo(/*0*/ x: T, /*1*/ builder: T.() -> kotlin.Unit): kotlin.Unit public fun test(): kotlin.Unit public final class Bar { diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferences.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferences.fir.kt index 69eb2ee59b6..80704d628da 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferences.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferences.fir.kt @@ -30,7 +30,7 @@ fun foo7() = null as Foo7 interface FlowCollector {} -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit): Flow = Flow(block) +fun flow(block: suspend FlowCollector.() -> Unit): Flow = Flow(block) class Flow(private val block: suspend FlowCollector.() -> Unit) diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferences.kt b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferences.kt index 333a036ce86..14a7815a728 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferences.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferences.kt @@ -30,7 +30,7 @@ fun foo7() = null as Foo7 interface FlowCollector {} -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit): Flow = Flow(block) +fun flow(block: suspend FlowCollector.() -> Unit): Flow = Flow(block) class Flow(private val block: suspend FlowCollector.() -> Unit) diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExression.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExression.fir.kt index 89d59f01493..8a7000fc751 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExression.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExression.fir.kt @@ -30,7 +30,7 @@ fun foo7() = null as Foo7 interface FlowCollector {} -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit) = Flow(block) +fun flow(block: suspend FlowCollector.() -> Unit) = Flow(block) class Flow(private val block: suspend FlowCollector.() -> Unit) diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt index 4998d2f22f5..3bc201dc9bc 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt @@ -30,7 +30,7 @@ fun foo7() = null as Foo7 interface FlowCollector {} -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit) = Flow(block) +fun flow(block: suspend FlowCollector.() -> Unit) = Flow(block) class Flow(private val block: suspend FlowCollector.() -> Unit) diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.fir.kt index a911d2da861..586d14baba0 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.fir.kt @@ -30,7 +30,7 @@ fun foo7() = null as Foo7 interface FlowCollector {} -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit) = Flow(block) +fun flow(block: suspend FlowCollector.() -> Unit) = Flow(block) class Flow(private val block: suspend FlowCollector.() -> Unit) diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt index 9f1f66c2b11..8655b3e78d6 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontRewriteAtSlice.kt @@ -30,7 +30,7 @@ fun foo7() = null as Foo7 interface FlowCollector {} -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit) = Flow(block) +fun flow(block: suspend FlowCollector.() -> Unit) = Flow(block) class Flow(private val block: suspend FlowCollector.() -> Unit) diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorType.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorType.fir.kt index 8b812f175b9..da79c374535 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorType.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorType.fir.kt @@ -30,7 +30,7 @@ fun foo7() = null as Foo7 interface FlowCollector {} -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit) = Flow(block) +fun flow(block: suspend FlowCollector.() -> Unit) = Flow(block) class Flow(private val block: suspend FlowCollector.() -> Unit) diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt index e7768d436a3..d51fac922f6 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt @@ -30,7 +30,7 @@ fun foo7() = null as Foo7 interface FlowCollector {} -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit) = Flow(block) +fun flow(block: suspend FlowCollector.() -> Unit) = Flow(block) class Flow(private val block: suspend FlowCollector.() -> Unit) diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorTypeUnrestricted.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorTypeUnrestricted.fir.kt index fd772ed4359..a4d7d23fdce 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorTypeUnrestricted.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorTypeUnrestricted.fir.kt @@ -31,7 +31,7 @@ fun foo7() = null as Foo7 interface FlowCollector {} -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit) = Flow(block) +fun flow(block: suspend FlowCollector.() -> Unit) = Flow(block) class Flow(private val block: suspend FlowCollector.() -> Unit) diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorTypeUnrestricted.kt b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorTypeUnrestricted.kt index e1330bc67e9..cc21d7b9aaa 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorTypeUnrestricted.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorTypeUnrestricted.kt @@ -31,7 +31,7 @@ fun foo7() = null as Foo7 interface FlowCollector {} -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit) = Flow(block) +fun flow(block: suspend FlowCollector.() -> Unit) = Flow(block) class Flow(private val block: suspend FlowCollector.() -> Unit) diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.fir.kt index 6b3853bd09b..33695387e0f 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.fir.kt @@ -16,7 +16,7 @@ var foo4: Float interface FlowCollector {} -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit) = Flow(block) +fun flow(block: suspend FlowCollector.() -> Unit) = Flow(block) class Flow(private val block: suspend FlowCollector.() -> Unit) diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt index c58b6046537..f001ea20f1f 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesNonStrictOnlyInputTypes.kt @@ -16,7 +16,7 @@ var foo4: Float interface FlowCollector {} -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit) = Flow(block) +fun flow(block: suspend FlowCollector.() -> Unit) = Flow(block) class Flow(private val block: suspend FlowCollector.() -> Unit) diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesUnrestricted.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesUnrestricted.fir.kt index a9be6f377d3..87ee7c64135 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesUnrestricted.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesUnrestricted.fir.kt @@ -32,7 +32,7 @@ fun foo7() = null as Foo7 interface FlowCollector {} -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit): Flow = Flow(block) +fun flow(block: suspend FlowCollector.() -> Unit): Flow = Flow(block) class Flow(private val block: suspend FlowCollector.() -> Unit) diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesUnrestricted.kt b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesUnrestricted.kt index 5ab7b2376a8..48b351e5bdf 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesUnrestricted.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesUnrestricted.kt @@ -32,7 +32,7 @@ fun foo7() = null as Foo7 interface FlowCollector {} -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit): Flow = Flow(block) +fun flow(block: suspend FlowCollector.() -> Unit): Flow = Flow(block) class Flow(private val block: suspend FlowCollector.() -> Unit) diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithLambdas.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithLambdas.fir.kt index 1bdc8042118..97011acaaf3 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithLambdas.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithLambdas.fir.kt @@ -6,7 +6,7 @@ import kotlin.experimental.ExperimentalTypeInference interface FlowCollector {} -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit) = Flow(block) +fun flow(block: suspend FlowCollector.() -> Unit) = Flow(block) class Flow(private val block: suspend FlowCollector.() -> Unit) diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithLambdas.kt b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithLambdas.kt index b84a208018e..d4915287750 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithLambdas.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithLambdas.kt @@ -6,7 +6,7 @@ import kotlin.experimental.ExperimentalTypeInference interface FlowCollector {} -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit) = Flow(block) +fun flow(block: suspend FlowCollector.() -> Unit) = Flow(block) class Flow(private val block: suspend FlowCollector.() -> Unit) diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/capturedTypes.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/capturedTypes.fir.kt index 1e6d6462650..2f277f0f465 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/capturedTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/capturedTypes.fir.kt @@ -6,10 +6,10 @@ import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit): R = TODO() +fun build(block: TestInterface.() -> Unit): R = TODO() @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit): R = TODO() +fun build2(block: TestInterface.() -> Unit): R = TODO() interface TestInterface { fun emit(r: R) diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/capturedTypes.kt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/capturedTypes.kt index 34d70b92de7..1545a713855 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/capturedTypes.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/capturedTypes.kt @@ -6,10 +6,10 @@ import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit): R = TODO() +fun build(block: TestInterface.() -> Unit): R = TODO() @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit): R = TODO() +fun build2(block: TestInterface.() -> Unit): R = TODO() interface TestInterface { fun emit(r: R) diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/capturedTypes.txt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/capturedTypes.txt index 2ce5ffa5eb6..22bd479d508 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/capturedTypes.txt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/capturedTypes.txt @@ -1,7 +1,7 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ @kotlin.BuilderInference block: TestInterface.() -> kotlin.Unit): R -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build2(/*0*/ @kotlin.BuilderInference block: TestInterface.() -> kotlin.Unit): R +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ block: TestInterface.() -> kotlin.Unit): R +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build2(/*0*/ block: TestInterface.() -> kotlin.Unit): R public fun capture(/*0*/ x: Inv): K public fun captureIn(/*0*/ x: Inv): K public fun captureOut(/*0*/ x: Inv): K diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperType.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperType.fir.kt index 6db309e0506..328956b924f 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperType.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperType.fir.kt @@ -12,10 +12,10 @@ class Test { import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit): R = TODO() +fun build(block: TestInterface.() -> Unit): R = TODO() @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit): R = TODO() +fun build2(block: TestInterface.() -> Unit): R = TODO() class Inv diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperType.kt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperType.kt index c00b5d0e24e..e6906e50afa 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperType.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperType.kt @@ -12,10 +12,10 @@ class Test { import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit): R = TODO() +fun build(block: TestInterface.() -> Unit): R = TODO() @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit): R = TODO() +fun build2(block: TestInterface.() -> Unit): R = TODO() class Inv diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperType.txt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperType.txt index f28de25d7cf..186c05aa63f 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperType.txt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperType.txt @@ -1,7 +1,7 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ @kotlin.BuilderInference block: TestInterface.() -> kotlin.Unit): R -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build2(/*0*/ @kotlin.BuilderInference block: TestInterface.() -> kotlin.Unit): R +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ block: TestInterface.() -> kotlin.Unit): R +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build2(/*0*/ block: TestInterface.() -> kotlin.Unit): R public fun id(/*0*/ x: U): U public fun select(/*0*/ vararg x: E /*kotlin.Array*/): E public fun test(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeContravariant.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeContravariant.fir.kt index e1980d1a743..e9c4c7cc52b 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeContravariant.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeContravariant.fir.kt @@ -12,10 +12,10 @@ class Test { import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit): R1 = TODO() +fun build(block: TestInterface.() -> Unit): R1 = TODO() @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit): R2 = TODO() +fun build2(block: TestInterface.() -> Unit): R2 = TODO() class In diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeContravariant.kt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeContravariant.kt index 312c306726c..9ac82866d34 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeContravariant.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeContravariant.kt @@ -12,10 +12,10 @@ class Test { import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit): R1 = TODO() +fun build(block: TestInterface.() -> Unit): R1 = TODO() @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit): R2 = TODO() +fun build2(block: TestInterface.() -> Unit): R2 = TODO() class In diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeContravariant.txt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeContravariant.txt index 53b0f3a07b9..68b3f601ec5 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeContravariant.txt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeContravariant.txt @@ -1,7 +1,7 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ @kotlin.BuilderInference block: TestInterface.() -> kotlin.Unit): R1 -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build2(/*0*/ @kotlin.BuilderInference block: TestInterface.() -> kotlin.Unit): R2 +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ block: TestInterface.() -> kotlin.Unit): R1 +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build2(/*0*/ block: TestInterface.() -> kotlin.Unit): R2 public fun id(/*0*/ x: U): U? public fun select1(/*0*/ x: E, /*1*/ y: In): E? public fun select2(/*0*/ x: E, /*1*/ y: In): E diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeCovariant.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeCovariant.fir.kt index 4d7a41dd0c6..d1fd795fef6 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeCovariant.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeCovariant.fir.kt @@ -12,10 +12,10 @@ class Test { import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit): R1 = TODO() +fun build(block: TestInterface.() -> Unit): R1 = TODO() @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit): R2 = TODO() +fun build2(block: TestInterface.() -> Unit): R2 = TODO() class Out diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeCovariant.kt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeCovariant.kt index 5ae6c00516f..11e5733030e 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeCovariant.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeCovariant.kt @@ -12,10 +12,10 @@ class Test { import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit): R1 = TODO() +fun build(block: TestInterface.() -> Unit): R1 = TODO() @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit): R2 = TODO() +fun build2(block: TestInterface.() -> Unit): R2 = TODO() class Out diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeCovariant.txt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeCovariant.txt index c88f9be0ef7..5848af37df9 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeCovariant.txt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeCovariant.txt @@ -1,7 +1,7 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ @kotlin.BuilderInference block: TestInterface.() -> kotlin.Unit): R1 -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build2(/*0*/ @kotlin.BuilderInference block: TestInterface.() -> kotlin.Unit): R2 +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ block: TestInterface.() -> kotlin.Unit): R1 +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build2(/*0*/ block: TestInterface.() -> kotlin.Unit): R2 public fun id(/*0*/ x: U): U? public fun select1(/*0*/ x: E, /*1*/ y: Out): E? public fun select2(/*0*/ x: E, /*1*/ y: Out): E diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeInvariant.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeInvariant.fir.kt index 25ed73339ad..877abc4f9b8 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeInvariant.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeInvariant.fir.kt @@ -12,10 +12,10 @@ class Test { import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit): R1 = TODO() +fun build(block: TestInterface.() -> Unit): R1 = TODO() @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit): R2 = TODO() +fun build2(block: TestInterface.() -> Unit): R2 = TODO() class Inv diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeInvariant.kt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeInvariant.kt index de963096356..eb362897913 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeInvariant.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeInvariant.kt @@ -12,10 +12,10 @@ class Test { import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit): R1 = TODO() +fun build(block: TestInterface.() -> Unit): R1 = TODO() @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit): R2 = TODO() +fun build2(block: TestInterface.() -> Unit): R2 = TODO() class Inv diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeInvariant.txt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeInvariant.txt index b602a7a791c..f26a3d75ffe 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeInvariant.txt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeInvariant.txt @@ -1,7 +1,7 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ @kotlin.BuilderInference block: TestInterface.() -> kotlin.Unit): R1 -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build2(/*0*/ @kotlin.BuilderInference block: TestInterface.() -> kotlin.Unit): R2 +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ block: TestInterface.() -> kotlin.Unit): R1 +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build2(/*0*/ block: TestInterface.() -> kotlin.Unit): R2 public fun id(/*0*/ x: U): U? public fun select1(/*0*/ x: E, /*1*/ y: Inv): E? public fun select2(/*0*/ x: E, /*1*/ y: Inv): E diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeNullable.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeNullable.fir.kt index c86b4ee9bd5..220c79bf8ae 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeNullable.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeNullable.fir.kt @@ -15,10 +15,10 @@ class Test { import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit): R = TODO() +fun build(block: TestInterface.() -> Unit): R = TODO() @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit): R = TODO() +fun build2(block: TestInterface.() -> Unit): R = TODO() class Inv diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeNullable.kt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeNullable.kt index 4837649d60a..8af8237b075 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeNullable.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeNullable.kt @@ -15,10 +15,10 @@ class Test { import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit): R = TODO() +fun build(block: TestInterface.() -> Unit): R = TODO() @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit): R = TODO() +fun build2(block: TestInterface.() -> Unit): R = TODO() class Inv diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeNullable.txt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeNullable.txt index a50e79c8f8d..18540b54b52 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeNullable.txt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeNullable.txt @@ -1,7 +1,7 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ @kotlin.BuilderInference block: TestInterface.() -> kotlin.Unit): R -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build2(/*0*/ @kotlin.BuilderInference block: TestInterface.() -> kotlin.Unit): R +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ block: TestInterface.() -> kotlin.Unit): R +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build2(/*0*/ block: TestInterface.() -> kotlin.Unit): R public fun id(/*0*/ x: U): U? public fun select(/*0*/ vararg x: E /*kotlin.Array*/): E? public fun test(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/intersect.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/intersect.fir.kt index 63ae5775b52..20fbfebaec0 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/intersect.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/intersect.fir.kt @@ -12,10 +12,10 @@ class Test { import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit): R1 = TODO() +fun build(block: TestInterface.() -> Unit): R1 = TODO() @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit): R2 = TODO() +fun build2(block: TestInterface.() -> Unit): R2 = TODO() class In diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/intersect.kt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/intersect.kt index 4b92674c263..903a9b09ff4 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/intersect.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/intersect.kt @@ -12,10 +12,10 @@ class Test { import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit): R1 = TODO() +fun build(block: TestInterface.() -> Unit): R1 = TODO() @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit): R2 = TODO() +fun build2(block: TestInterface.() -> Unit): R2 = TODO() class In diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/intersect.txt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/intersect.txt index c56982c82ac..4b38f93ec71 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/intersect.txt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/intersect.txt @@ -1,7 +1,7 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ @kotlin.BuilderInference block: TestInterface.() -> kotlin.Unit): R1 -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build2(/*0*/ @kotlin.BuilderInference block: TestInterface.() -> kotlin.Unit): R2 +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ block: TestInterface.() -> kotlin.Unit): R1 +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build2(/*0*/ block: TestInterface.() -> kotlin.Unit): R2 public fun id(/*0*/ x: U): U public fun intersect(/*0*/ vararg x: In /*kotlin.Array>*/): E public fun test(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/memberScope.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/memberScope.fir.kt index 7e781212d4c..2eea7892597 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/memberScope.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/memberScope.fir.kt @@ -11,7 +11,7 @@ interface TestInterface { } @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit): R1 = TODO() +fun build(block: TestInterface.() -> Unit): R1 = TODO() fun Any.test() {} fun Any?.test2() {} diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/memberScope.kt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/memberScope.kt index 137af28d325..821f280ae66 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/memberScope.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/memberScope.kt @@ -11,7 +11,7 @@ interface TestInterface { } @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit): R1 = TODO() +fun build(block: TestInterface.() -> Unit): R1 = TODO() fun Any.test() {} fun Any?.test2() {} diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/memberScope.txt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/memberScope.txt index 74757fd1d8c..0e50fe97377 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/memberScope.txt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/memberScope.txt @@ -1,6 +1,6 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ @kotlin.BuilderInference block: TestInterface.() -> kotlin.Unit): R1 +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ block: TestInterface.() -> kotlin.Unit): R1 public fun test(): kotlin.Unit public fun kotlin.Any.test(): kotlin.Unit public fun kotlin.Any?.test2(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/nullability.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/nullability.fir.kt index f328fcb7cf1..133ad7932b0 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/nullability.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/nullability.fir.kt @@ -11,16 +11,16 @@ interface TestInterface { } @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit): R1 = TODO() +fun build(block: TestInterface.() -> Unit): R1 = TODO() @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit): R1 = TODO() +fun build2(block: TestInterface.() -> Unit): R1 = TODO() @OptIn(ExperimentalTypeInference::class) -fun build3(@BuilderInference block: TestInterface.() -> Unit): R1 = TODO() +fun build3(block: TestInterface.() -> Unit): R1 = TODO() @OptIn(ExperimentalTypeInference::class) -fun build4(x: R2, @BuilderInference block: TestInterface.() -> Unit): R1 = TODO() +fun build4(x: R2, block: TestInterface.() -> Unit): R1 = TODO() fun test(a: String?) { val ret1 = build { diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/nullability.kt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/nullability.kt index a2d9c8296c2..ee75aa7acb2 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/nullability.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/nullability.kt @@ -11,16 +11,16 @@ interface TestInterface { } @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference block: TestInterface.() -> Unit): R1 = TODO() +fun build(block: TestInterface.() -> Unit): R1 = TODO() @OptIn(ExperimentalTypeInference::class) -fun build2(@BuilderInference block: TestInterface.() -> Unit): R1 = TODO() +fun build2(block: TestInterface.() -> Unit): R1 = TODO() @OptIn(ExperimentalTypeInference::class) -fun build3(@BuilderInference block: TestInterface.() -> Unit): R1 = TODO() +fun build3(block: TestInterface.() -> Unit): R1 = TODO() @OptIn(ExperimentalTypeInference::class) -fun build4(x: R2, @BuilderInference block: TestInterface.() -> Unit): R1 = TODO() +fun build4(x: R2, block: TestInterface.() -> Unit): R1 = TODO() fun test(a: String?) { val ret1 = build { diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/nullability.txt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/nullability.txt index b6666359039..70ad9e47880 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/nullability.txt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/nullability.txt @@ -1,9 +1,9 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ @kotlin.BuilderInference block: TestInterface.() -> kotlin.Unit): R1 -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build2(/*0*/ @kotlin.BuilderInference block: TestInterface.() -> kotlin.Unit): R1 -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build3(/*0*/ @kotlin.BuilderInference block: TestInterface.() -> kotlin.Unit): R1 -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build4(/*0*/ x: R2, /*1*/ @kotlin.BuilderInference block: TestInterface.() -> kotlin.Unit): R1 +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ block: TestInterface.() -> kotlin.Unit): R1 +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build2(/*0*/ block: TestInterface.() -> kotlin.Unit): R1 +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build3(/*0*/ block: TestInterface.() -> kotlin.Unit): R1 +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build4(/*0*/ x: R2, /*1*/ block: TestInterface.() -> kotlin.Unit): R1 public fun test(/*0*/ a: kotlin.String?): kotlin.Unit public interface TestInterface { diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/renderingStubTypes.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/renderingStubTypes.fir.kt index 70bf44904db..8257cd27136 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/renderingStubTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/renderingStubTypes.fir.kt @@ -6,7 +6,7 @@ import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) fun build( - @BuilderInference block: TestInterface.() -> Unit + block: TestInterface.() -> Unit ): R = TODO() class Inv diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/renderingStubTypes.kt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/renderingStubTypes.kt index b74c939e705..cdd87127b1d 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/renderingStubTypes.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/renderingStubTypes.kt @@ -6,7 +6,7 @@ import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) fun build( - @BuilderInference block: TestInterface.() -> Unit + block: TestInterface.() -> Unit ): R = TODO() class Inv diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/renderingStubTypes.txt b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/renderingStubTypes.txt index 1a34195dc98..78874084ff3 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/renderingStubTypes.txt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/renderingStubTypes.txt @@ -1,6 +1,6 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ @kotlin.BuilderInference block: TestInterface.() -> kotlin.Unit): R +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ block: TestInterface.() -> kotlin.Unit): R public fun id(/*0*/ x: U): U public fun test(): kotlin.Unit diff --git a/compiler/testData/diagnostics/testsWithStdLib/builderInference/incorrectCalls.kt b/compiler/testData/diagnostics/testsWithStdLib/builderInference/incorrectCalls.kt index 526b4c563d3..7e4923a5f8c 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/builderInference/incorrectCalls.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/builderInference/incorrectCalls.kt @@ -15,7 +15,7 @@ class GenericController { fun barReturnType(): T = TODO() } -fun generate(@BuilderInference g: suspend GenericController.() -> Unit): List = TODO() +fun generate(g: suspend GenericController.() -> Unit): List = TODO() val test1 = generate { yield(3) diff --git a/compiler/testData/diagnostics/testsWithStdLib/builderInference/incorrectCalls.txt b/compiler/testData/diagnostics/testsWithStdLib/builderInference/incorrectCalls.txt index aa1fb869364..cb114e9f144 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/builderInference/incorrectCalls.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/builderInference/incorrectCalls.txt @@ -4,7 +4,7 @@ public val test1: kotlin.collections.List public val test2: kotlin.collections.List public val test3: kotlin.collections.List public val test4: kotlin.collections.List -public fun generate(/*0*/ @kotlin.BuilderInference g: suspend GenericController.() -> kotlin.Unit): kotlin.collections.List +public fun generate(/*0*/ g: suspend GenericController.() -> kotlin.Unit): kotlin.collections.List public final class GenericController { public constructor GenericController() diff --git a/compiler/testData/diagnostics/testsWithStdLib/builderInference/incorrectCallsWithRestrictions.kt b/compiler/testData/diagnostics/testsWithStdLib/builderInference/incorrectCallsWithRestrictions.kt index f80649f75b4..354b6fc21a6 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/builderInference/incorrectCallsWithRestrictions.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/builderInference/incorrectCallsWithRestrictions.kt @@ -14,7 +14,7 @@ class GenericController { fun barReturnType(): T = TODO() } -fun generate(@BuilderInference g: suspend GenericController.() -> Unit): List = TODO() +fun generate(g: suspend GenericController.() -> Unit): List = TODO() val test1 = generate { yield(3) diff --git a/compiler/testData/diagnostics/testsWithStdLib/builderInference/incorrectCallsWithRestrictions.txt b/compiler/testData/diagnostics/testsWithStdLib/builderInference/incorrectCallsWithRestrictions.txt index aa1fb869364..cb114e9f144 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/builderInference/incorrectCallsWithRestrictions.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/builderInference/incorrectCallsWithRestrictions.txt @@ -4,7 +4,7 @@ public val test1: kotlin.collections.List public val test2: kotlin.collections.List public val test3: kotlin.collections.List public val test4: kotlin.collections.List -public fun generate(/*0*/ @kotlin.BuilderInference g: suspend GenericController.() -> kotlin.Unit): kotlin.collections.List +public fun generate(/*0*/ g: suspend GenericController.() -> kotlin.Unit): kotlin.collections.List public final class GenericController { public constructor GenericController() diff --git a/compiler/testData/diagnostics/testsWithStdLib/builderInference/resolveUsualCallWithBuilderInference.kt b/compiler/testData/diagnostics/testsWithStdLib/builderInference/resolveUsualCallWithBuilderInference.kt index 677ce2030fc..63df776af5a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/builderInference/resolveUsualCallWithBuilderInference.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/builderInference/resolveUsualCallWithBuilderInference.kt @@ -14,12 +14,11 @@ class Builder { fun add(t: T) {} } -fun build(@BuilderInference g: Builder.() -> Unit): List = TODO() +fun build(g: Builder.() -> Unit): List = TODO() fun wrongBuild(g: Builder.() -> Unit): List = TODO() fun Builder.extensionAdd(s: S) {} -@BuilderInference fun Builder.safeExtensionAdd(s: S) {} val member = build { diff --git a/compiler/testData/diagnostics/testsWithStdLib/builderInference/resolveUsualCallWithBuilderInference.txt b/compiler/testData/diagnostics/testsWithStdLib/builderInference/resolveUsualCallWithBuilderInference.txt index 5fb9bdce912..8a3f6d664a7 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/builderInference/resolveUsualCallWithBuilderInference.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/builderInference/resolveUsualCallWithBuilderInference.txt @@ -4,10 +4,10 @@ public val extension: kotlin.collections.List public val member: kotlin.collections.List public val memberWithoutAnn: kotlin.collections.List public val safeExtension: kotlin.collections.List -public fun build(/*0*/ @kotlin.BuilderInference g: Builder.() -> kotlin.Unit): kotlin.collections.List +public fun build(/*0*/ g: Builder.() -> kotlin.Unit): kotlin.collections.List public fun wrongBuild(/*0*/ g: Builder.() -> kotlin.Unit): kotlin.collections.List public fun Builder.extensionAdd(/*0*/ s: S): kotlin.Unit -@kotlin.BuilderInference public fun Builder.safeExtensionAdd(/*0*/ s: S): kotlin.Unit +public fun Builder.safeExtensionAdd(/*0*/ s: S): kotlin.Unit public final class Builder { public constructor Builder() diff --git a/compiler/testData/diagnostics/testsWithStdLib/builderInference/resolveUsualCallWithBuilderInferenceWithRestrictions.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/builderInference/resolveUsualCallWithBuilderInferenceWithRestrictions.fir.kt index 818332bb37d..3c09c1b7389 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/builderInference/resolveUsualCallWithBuilderInferenceWithRestrictions.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/builderInference/resolveUsualCallWithBuilderInferenceWithRestrictions.fir.kt @@ -13,12 +13,11 @@ class Builder { fun add(t: T) {} } -fun build(@BuilderInference g: Builder.() -> Unit): List = TODO() +fun build(g: Builder.() -> Unit): List = TODO() fun wrongBuild(g: Builder.() -> Unit): List = TODO() fun Builder.extensionAdd(s: S) {} -@BuilderInference fun Builder.safeExtensionAdd(s: S) {} val member = build { diff --git a/compiler/testData/diagnostics/testsWithStdLib/builderInference/resolveUsualCallWithBuilderInferenceWithRestrictions.kt b/compiler/testData/diagnostics/testsWithStdLib/builderInference/resolveUsualCallWithBuilderInferenceWithRestrictions.kt index ed3741c1338..1633dab1f0d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/builderInference/resolveUsualCallWithBuilderInferenceWithRestrictions.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/builderInference/resolveUsualCallWithBuilderInferenceWithRestrictions.kt @@ -13,12 +13,11 @@ class Builder { fun add(t: T) {} } -fun build(@BuilderInference g: Builder.() -> Unit): List = TODO() +fun build(g: Builder.() -> Unit): List = TODO() fun wrongBuild(g: Builder.() -> Unit): List = TODO() fun Builder.extensionAdd(s: S) {} -@BuilderInference fun Builder.safeExtensionAdd(s: S) {} val member = build { diff --git a/compiler/testData/diagnostics/testsWithStdLib/builderInference/resolveUsualCallWithBuilderInferenceWithRestrictions.txt b/compiler/testData/diagnostics/testsWithStdLib/builderInference/resolveUsualCallWithBuilderInferenceWithRestrictions.txt index 5fb9bdce912..8a3f6d664a7 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/builderInference/resolveUsualCallWithBuilderInferenceWithRestrictions.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/builderInference/resolveUsualCallWithBuilderInferenceWithRestrictions.txt @@ -4,10 +4,10 @@ public val extension: kotlin.collections.List public val member: kotlin.collections.List public val memberWithoutAnn: kotlin.collections.List public val safeExtension: kotlin.collections.List -public fun build(/*0*/ @kotlin.BuilderInference g: Builder.() -> kotlin.Unit): kotlin.collections.List +public fun build(/*0*/ g: Builder.() -> kotlin.Unit): kotlin.collections.List public fun wrongBuild(/*0*/ g: Builder.() -> kotlin.Unit): kotlin.collections.List public fun Builder.extensionAdd(/*0*/ s: S): kotlin.Unit -@kotlin.BuilderInference public fun Builder.safeExtensionAdd(/*0*/ s: S): kotlin.Unit +public fun Builder.safeExtensionAdd(/*0*/ s: S): kotlin.Unit public final class Builder { public constructor Builder() diff --git a/compiler/testData/diagnostics/testsWithStdLib/builderInference/useInferenceInformationFromExtension.kt b/compiler/testData/diagnostics/testsWithStdLib/builderInference/useInferenceInformationFromExtension.kt index a6588a43bc9..69ffe0282d1 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/builderInference/useInferenceInformationFromExtension.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/builderInference/useInferenceInformationFromExtension.kt @@ -17,10 +17,9 @@ class GenericController { suspend fun GenericController.extensionYield(s: S) {} -@BuilderInference suspend fun GenericController.safeExtensionYield(s: S) {} -fun generate(@BuilderInference g: suspend GenericController.() -> Unit): List = TODO() +fun generate(g: suspend GenericController.() -> Unit): List = TODO() val normal = generate { yield(42) diff --git a/compiler/testData/diagnostics/testsWithStdLib/builderInference/useInferenceInformationFromExtension.txt b/compiler/testData/diagnostics/testsWithStdLib/builderInference/useInferenceInformationFromExtension.txt index 9a2789c7e6e..f702b27ffe3 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/builderInference/useInferenceInformationFromExtension.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/builderInference/useInferenceInformationFromExtension.txt @@ -3,9 +3,9 @@ package public val extension: kotlin.collections.List public val normal: kotlin.collections.List public val safeExtension: kotlin.collections.List -public fun generate(/*0*/ @kotlin.BuilderInference g: suspend GenericController.() -> kotlin.Unit): kotlin.collections.List +public fun generate(/*0*/ g: suspend GenericController.() -> kotlin.Unit): kotlin.collections.List public suspend fun GenericController.extensionYield(/*0*/ s: S): kotlin.Unit -@kotlin.BuilderInference public suspend fun GenericController.safeExtensionYield(/*0*/ s: S): kotlin.Unit +public suspend fun GenericController.safeExtensionYield(/*0*/ s: S): kotlin.Unit public final class GenericController { public constructor GenericController() diff --git a/compiler/testData/diagnostics/testsWithStdLib/builderInference/useInferenceInformationFromExtensionWithRestrictions.kt b/compiler/testData/diagnostics/testsWithStdLib/builderInference/useInferenceInformationFromExtensionWithRestrictions.kt index 55334c1ea83..0f830fe11b7 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/builderInference/useInferenceInformationFromExtensionWithRestrictions.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/builderInference/useInferenceInformationFromExtensionWithRestrictions.kt @@ -16,10 +16,9 @@ class GenericController { suspend fun GenericController.extensionYield(s: S) {} -@BuilderInference suspend fun GenericController.safeExtensionYield(s: S) {} -fun generate(@BuilderInference g: suspend GenericController.() -> Unit): List = TODO() +fun generate(g: suspend GenericController.() -> Unit): List = TODO() val normal = generate { yield(42) diff --git a/compiler/testData/diagnostics/testsWithStdLib/builderInference/useInferenceInformationFromExtensionWithRestrictions.txt b/compiler/testData/diagnostics/testsWithStdLib/builderInference/useInferenceInformationFromExtensionWithRestrictions.txt index 9a2789c7e6e..f702b27ffe3 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/builderInference/useInferenceInformationFromExtensionWithRestrictions.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/builderInference/useInferenceInformationFromExtensionWithRestrictions.txt @@ -3,9 +3,9 @@ package public val extension: kotlin.collections.List public val normal: kotlin.collections.List public val safeExtension: kotlin.collections.List -public fun generate(/*0*/ @kotlin.BuilderInference g: suspend GenericController.() -> kotlin.Unit): kotlin.collections.List +public fun generate(/*0*/ g: suspend GenericController.() -> kotlin.Unit): kotlin.collections.List public suspend fun GenericController.extensionYield(/*0*/ s: S): kotlin.Unit -@kotlin.BuilderInference public suspend fun GenericController.safeExtensionYield(/*0*/ s: S): kotlin.Unit +public suspend fun GenericController.safeExtensionYield(/*0*/ s: S): kotlin.Unit public final class GenericController { public constructor GenericController() diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/chainCallWithExtensionExplicitTypes.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/chainCallWithExtensionExplicitTypes.kt index 5eb9b23e7d4..37627755b32 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/chainCallWithExtensionExplicitTypes.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/chainCallWithExtensionExplicitTypes.kt @@ -14,7 +14,7 @@ class CoroutineScope class ReceiveChannel @OptIn(ExperimentalTypeInference::class) -public fun produce(@BuilderInference block: suspend ProducerScope.() -> Unit): ProducerScope = TODO() +public fun produce(block: suspend ProducerScope.() -> Unit): ProducerScope = TODO() fun test(ls: List) = produce { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/chainCallWithExtensionExplicitTypes.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/chainCallWithExtensionExplicitTypes.txt index 48566025776..335217f9dd6 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/chainCallWithExtensionExplicitTypes.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/chainCallWithExtensionExplicitTypes.txt @@ -1,6 +1,6 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun produce(/*0*/ @kotlin.BuilderInference block: suspend ProducerScope.() -> kotlin.Unit): ProducerScope +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun produce(/*0*/ block: suspend ProducerScope.() -> kotlin.Unit): ProducerScope public fun test(/*0*/ ls: kotlin.collections.List): ProducerScope private fun kotlin.collections.Iterable.asReceiveChannel(): ReceiveChannel public suspend fun ReceiveChannel.toChannel(/*0*/ destination: C): C diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/coroutineInferenceWithCapturedTypeVariable.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/coroutineInferenceWithCapturedTypeVariable.kt index 50339cb5869..003cbe09722 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/coroutineInferenceWithCapturedTypeVariable.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/coroutineInferenceWithCapturedTypeVariable.kt @@ -11,7 +11,7 @@ suspend fun main() { @OptIn(ExperimentalTypeInference::class) -fun iFlow(@BuilderInference block: suspend iFlowCollector.() -> Unit): iFlow = TODO() +fun iFlow(block: suspend iFlowCollector.() -> Unit): iFlow = TODO() interface iFlowCollector { suspend fun emit(value: S) diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/coroutineInferenceWithCapturedTypeVariable.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/coroutineInferenceWithCapturedTypeVariable.txt index b9fd3273e00..282ae8eca70 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/coroutineInferenceWithCapturedTypeVariable.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/coroutineInferenceWithCapturedTypeVariable.txt @@ -1,6 +1,6 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun iFlow(/*0*/ @kotlin.BuilderInference block: suspend iFlowCollector.() -> kotlin.Unit): iFlow +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun iFlow(/*0*/ block: suspend iFlowCollector.() -> kotlin.Unit): iFlow public suspend fun main(): kotlin.Unit public interface iFlow { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/correctMember.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/correctMember.kt index 54dff05b779..23b7305e7c8 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/correctMember.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/correctMember.kt @@ -14,7 +14,7 @@ interface Controller { fun generidFun(t: Z) = t } -fun generate(@BuilderInference g: suspend Controller.() -> Unit): S = TODO() +fun generate(g: suspend Controller.() -> Unit): S = TODO() val test1 = generate { yield(justString()) diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/correctMember.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/correctMember.txt index 94cf52b9dcf..288fb4cac8e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/correctMember.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/correctMember.txt @@ -2,7 +2,7 @@ package public val test1: kotlin.String public val test2: kotlin.Int -public fun generate(/*0*/ @kotlin.BuilderInference g: suspend Controller.() -> kotlin.Unit): S +public fun generate(/*0*/ g: suspend Controller.() -> kotlin.Unit): S public interface Controller { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/doubleColonExpressionToClassWithParameters.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/doubleColonExpressionToClassWithParameters.kt index c5f62bc46e9..aa7931feb96 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/doubleColonExpressionToClassWithParameters.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/doubleColonExpressionToClassWithParameters.kt @@ -28,7 +28,7 @@ interface Scope { fun yield(t: T) {} } -fun generate(@BuilderInference g: Scope.() -> Unit): S = TODO() +fun generate(g: Scope.() -> Unit): S = TODO() val test2 = generate { { yield("foo") }::class diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/doubleColonExpressionToClassWithParameters.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/doubleColonExpressionToClassWithParameters.txt index 7d0e993043d..3780a6c3847 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/doubleColonExpressionToClassWithParameters.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/doubleColonExpressionToClassWithParameters.txt @@ -5,7 +5,7 @@ package a { package a.b { public val test2: kotlin.String public val test3: kotlin.String - public fun generate(/*0*/ @kotlin.BuilderInference g: a.b.Scope.() -> kotlin.Unit): S + public fun generate(/*0*/ g: a.b.Scope.() -> kotlin.Unit): S public fun test1(): kotlin.Unit public final class BatchInfo1 { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionPriority.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionPriority.kt index 1879433c4e4..ff29234433a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionPriority.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionPriority.kt @@ -8,12 +8,10 @@ import kotlin.experimental.ExperimentalTypeInference class GenericController -@BuilderInference suspend fun GenericController.yieldAll(s: Collection): String = "" -@BuilderInference suspend fun GenericController.yieldAll(s: Set): Int = 4 -fun generate(@BuilderInference g: suspend GenericController.() -> R): Pair = TODO() +fun generate(g: suspend GenericController.() -> R): Pair = TODO() val test1 = generate { yieldAll(setOf(4)) diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionPriority.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionPriority.txt index f7f1c393be5..edf07576028 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionPriority.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionPriority.txt @@ -2,11 +2,11 @@ package public val test1: Pair public val test2: Pair -public fun generate(/*0*/ @kotlin.BuilderInference g: suspend GenericController.() -> R): Pair +public fun generate(/*0*/ g: suspend GenericController.() -> R): Pair public fun listOf(/*0*/ vararg x: X /*kotlin.Array*/): kotlin.collections.List public fun setOf(/*0*/ vararg x: X /*kotlin.Array*/): kotlin.collections.Set -@kotlin.BuilderInference public suspend fun GenericController.yieldAll(/*0*/ s: kotlin.collections.Collection): kotlin.String -@kotlin.BuilderInference public suspend fun GenericController.yieldAll(/*0*/ s: kotlin.collections.Set): kotlin.Int +public suspend fun GenericController.yieldAll(/*0*/ s: kotlin.collections.Collection): kotlin.String +public suspend fun GenericController.yieldAll(/*0*/ s: kotlin.collections.Set): kotlin.Int public final class GenericController { public constructor GenericController() diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionSuspend.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionSuspend.kt index 5d9bd24b5cd..afff9cd9739 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionSuspend.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionSuspend.kt @@ -10,10 +10,9 @@ class GenericController { suspend fun yield(t: T) {} } -@BuilderInference suspend fun GenericController.yieldAll(s: Collection) {} -fun generate(@BuilderInference g: suspend GenericController.() -> Unit): S = TODO() +fun generate(g: suspend GenericController.() -> Unit): S = TODO() val test1 = generate { yield(4) diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionSuspend.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionSuspend.txt index 52a24452e13..b1212a4de77 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionSuspend.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionSuspend.txt @@ -4,9 +4,9 @@ public val test1: kotlin.Int public val test2: B public val test3: A public val test4: A -public fun generate(/*0*/ @kotlin.BuilderInference g: suspend GenericController.() -> kotlin.Unit): S +public fun generate(/*0*/ g: suspend GenericController.() -> kotlin.Unit): S public fun setOf(/*0*/ vararg x: X /*kotlin.Array*/): kotlin.collections.Set -@kotlin.BuilderInference public suspend fun GenericController.yieldAll(/*0*/ s: kotlin.collections.Collection): kotlin.Unit +public suspend fun GenericController.yieldAll(/*0*/ s: kotlin.collections.Collection): kotlin.Unit public interface A { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.fir.kt index 9756946f13b..c5dd98d7c5d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.fir.kt @@ -12,7 +12,7 @@ interface Controller : Base { suspend fun yield(t: T) {} } -fun generate(@BuilderInference g: suspend Controller.() -> Unit): S = TODO() +fun generate(g: suspend Controller.() -> Unit): S = TODO() fun Base.baseExtension() {} fun Controller.outNullableAnyExtension() {} @@ -20,7 +20,6 @@ fun Controller.outAnyExtension() {} fun Controller.invNullableAnyExtension() {} fun Controller.genericExtension() {} -@BuilderInference fun Controller.safeExtension() {} val test1 = generate { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.kt index b2557ffd215..da9ed1e5248 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.kt @@ -12,7 +12,7 @@ interface Controller : Base { suspend fun yield(t: T) {} } -fun generate(@BuilderInference g: suspend Controller.() -> Unit): S = TODO() +fun generate(g: suspend Controller.() -> Unit): S = TODO() fun Base.baseExtension() {} fun Controller.outNullableAnyExtension() {} @@ -20,7 +20,6 @@ fun Controller.outAnyExtension() {} fun Controller.invNullableAnyExtension() {} fun Controller.genericExtension() {} -@BuilderInference fun Controller.safeExtension() {} val test1 = generate { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.ni.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.ni.txt index 0972b686d7f..5f6829347aa 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.ni.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.ni.txt @@ -10,13 +10,13 @@ public val test5: kotlin.Int public val test6: kotlin.Any? public val test7: kotlin.Int public val test8: kotlin.String -public fun generate(/*0*/ @kotlin.BuilderInference g: suspend Controller.() -> kotlin.Unit): S +public fun generate(/*0*/ g: suspend Controller.() -> kotlin.Unit): S public fun Base.baseExtension(): kotlin.Unit public fun Controller.genericExtension(): kotlin.Unit public fun Controller.invNullableAnyExtension(): kotlin.Unit public fun Controller.outAnyExtension(): kotlin.Unit public fun Controller.outNullableAnyExtension(): kotlin.Unit -@kotlin.BuilderInference public fun Controller.safeExtension(): kotlin.Unit +public fun Controller.safeExtension(): kotlin.Unit public interface Base { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.txt index 626486cc23a..db041bc04a2 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.txt @@ -21,13 +21,13 @@ public val test7: [ERROR : Type for generate { genericExtension() }] public val test8: kotlin.String -public fun generate(/*0*/ @kotlin.BuilderInference g: suspend Controller.() -> kotlin.Unit): S +public fun generate(/*0*/ g: suspend Controller.() -> kotlin.Unit): S public fun Base.baseExtension(): kotlin.Unit public fun Controller.genericExtension(): kotlin.Unit public fun Controller.invNullableAnyExtension(): kotlin.Unit public fun Controller.outAnyExtension(): kotlin.Unit public fun Controller.outNullableAnyExtension(): kotlin.Unit -@kotlin.BuilderInference public fun Controller.safeExtension(): kotlin.Unit +public fun Controller.safeExtension(): kotlin.Unit public interface Base { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionsWithNonValuableConstraintsGenericBase.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionsWithNonValuableConstraintsGenericBase.kt index a16558bb422..6d81a261b8e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionsWithNonValuableConstraintsGenericBase.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionsWithNonValuableConstraintsGenericBase.kt @@ -17,8 +17,8 @@ interface SpecificController : Base { suspend fun yield(t: T) {} } -fun generate(@BuilderInference g: suspend Controller.() -> Unit): S = TODO() -fun generateSpecific(@BuilderInference g: suspend SpecificController.() -> Unit): S = TODO() +fun generate(g: suspend Controller.() -> Unit): S = TODO() +fun generateSpecific(g: suspend SpecificController.() -> Unit): S = TODO() fun Base<*>.starBase() {} fun Base.stringBase() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionsWithNonValuableConstraintsGenericBase.ni.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionsWithNonValuableConstraintsGenericBase.ni.txt index e76daded9af..9a3d74fc2fb 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionsWithNonValuableConstraintsGenericBase.ni.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionsWithNonValuableConstraintsGenericBase.ni.txt @@ -10,8 +10,8 @@ public val test5: kotlin.Int public val test6: [Error type: Not found recorded type for generateSpecific { stringBase() }] -public fun generate(/*0*/ @kotlin.BuilderInference g: suspend Controller.() -> kotlin.Unit): S -public fun generateSpecific(/*0*/ @kotlin.BuilderInference g: suspend SpecificController.() -> kotlin.Unit): S +public fun generate(/*0*/ g: suspend Controller.() -> kotlin.Unit): S +public fun generateSpecific(/*0*/ g: suspend SpecificController.() -> kotlin.Unit): S public fun Base<*>.starBase(): kotlin.Unit public fun Base.stringBase(): kotlin.Unit diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionsWithNonValuableConstraintsGenericBase.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionsWithNonValuableConstraintsGenericBase.txt index 4fb14b3ccda..20ec26b00da 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionsWithNonValuableConstraintsGenericBase.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionsWithNonValuableConstraintsGenericBase.txt @@ -13,8 +13,8 @@ public val test5: kotlin.Int public val test6: [ERROR : Type for generateSpecific { stringBase() }] -public fun generate(/*0*/ @kotlin.BuilderInference g: suspend Controller.() -> kotlin.Unit): S -public fun generateSpecific(/*0*/ @kotlin.BuilderInference g: suspend SpecificController.() -> kotlin.Unit): S +public fun generate(/*0*/ g: suspend Controller.() -> kotlin.Unit): S +public fun generateSpecific(/*0*/ g: suspend SpecificController.() -> kotlin.Unit): S public fun Base<*>.starBase(): kotlin.Unit public fun Base.stringBase(): kotlin.Unit diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferenceFromMethodInsideLocalVariable.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferenceFromMethodInsideLocalVariable.kt index dd2aa038cd8..db9cecf9bf7 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferenceFromMethodInsideLocalVariable.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferenceFromMethodInsideLocalVariable.kt @@ -9,7 +9,7 @@ interface Inv { } @OptIn(ExperimentalTypeInference::class) -fun foo(@BuilderInference block: Inv.() -> Unit) {} +fun foo(block: Inv.() -> Unit) {} fun test(i: Int) { foo { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferenceFromMethodInsideLocalVariable.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferenceFromMethodInsideLocalVariable.txt index c5ef7968688..853eb480a32 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferenceFromMethodInsideLocalVariable.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferenceFromMethodInsideLocalVariable.txt @@ -1,6 +1,6 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun foo(/*0*/ @kotlin.BuilderInference block: Inv.() -> kotlin.Unit): kotlin.Unit +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun foo(/*0*/ block: Inv.() -> kotlin.Unit): kotlin.Unit public fun test(/*0*/ i: kotlin.Int): kotlin.Unit public interface Inv { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt32097.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt32097.kt index 4f717fb7d46..ad248d1a1c4 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt32097.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt32097.kt @@ -14,7 +14,7 @@ interface Flow { } @OptIn(ExperimentalTypeInference::class) -fun channelFlow(@BuilderInference block: suspend ProducerScope.() -> Unit): Flow = TODO() +fun channelFlow(block: suspend ProducerScope.() -> Unit): Flow = TODO() interface ProducerScope diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt32097.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt32097.txt index 3d9f20a5432..2985129fa58 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt32097.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt32097.txt @@ -1,7 +1,7 @@ package public fun aFlow(): Flow -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun channelFlow(/*0*/ @kotlin.BuilderInference block: suspend ProducerScope.() -> kotlin.Unit): Flow +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun channelFlow(/*0*/ block: suspend ProducerScope.() -> kotlin.Unit): Flow public suspend fun ProducerScope<*>.awaitClose(/*0*/ block: () -> kotlin.Unit = ...): kotlin.Unit public interface Flow { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt32203.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt32203.kt index 00444e502f8..092ee3b5674 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt32203.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt32203.kt @@ -8,7 +8,7 @@ class Buildee class Builder @OptIn(ExperimentalTypeInference::class) -inline fun builder(@BuilderInference block: Builder.() -> Unit): Buildee = TODO() +inline fun builder(block: Builder.() -> Unit): Buildee = TODO() private fun Builder.consumer(builder: Builder): Unit = TODO() diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt32203.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt32203.txt index a7e96363433..5072a2fdddd 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt32203.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt32203.txt @@ -1,6 +1,6 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public inline fun builder(/*0*/ @kotlin.BuilderInference block: Builder.() -> kotlin.Unit): Buildee +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public inline fun builder(/*0*/ block: Builder.() -> kotlin.Unit): Buildee private fun Builder.consumer(/*0*/ builder: Builder): kotlin.Unit public fun Builder.foo(): Buildee diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt33542.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt33542.kt index 2de10a52c61..8a26d2389b4 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt33542.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt33542.kt @@ -13,7 +13,7 @@ class InImpl : In { } @OptIn(ExperimentalTypeInference::class) -public fun builder(@BuilderInference block: In.() -> Unit) { +public fun builder(block: In.() -> Unit) { InImpl().block() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt33542.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt33542.txt index 34d7b36dfe2..9e7237b15bb 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt33542.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt33542.txt @@ -1,6 +1,6 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun builder(/*0*/ @kotlin.BuilderInference block: In.() -> kotlin.Unit): kotlin.Unit +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun builder(/*0*/ block: In.() -> kotlin.Unit): kotlin.Unit public fun test(): kotlin.Unit public suspend fun yield(): kotlin.Unit diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35306.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35306.kt index 72dc69b5c94..2f3d842878f 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35306.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35306.kt @@ -8,7 +8,7 @@ import kotlin.experimental.ExperimentalTypeInference interface Build @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference fn: Builder.() -> Unit): Build = TODO() +fun build(fn: Builder.() -> Unit): Build = TODO() // Works completely val build = build { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35306.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35306.txt index d0469da501f..970255cdd8a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35306.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35306.txt @@ -4,7 +4,7 @@ public val build: Build public val buildWithFn: Build public val buildWithFnWrapped: Build public val buildWithWrappedValue: Build -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ @kotlin.BuilderInference fn: Builder.() -> kotlin.Unit): Build +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ fn: Builder.() -> kotlin.Unit): Build public interface Build { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.fir.kt index 645338b8cdf..a1aca0be910 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.fir.kt @@ -26,7 +26,7 @@ fun test_3() { } @OptIn(ExperimentalTypeInference::class) -fun sequence(@BuilderInference block: suspend Inv.() -> Unit): U = null!! +fun sequence(block: suspend Inv.() -> Unit): U = null!! interface Inv { fun yield(element: T) diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.kt index e429bbacecd..2100d11cad7 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.kt @@ -26,7 +26,7 @@ fun test_3() { } @OptIn(ExperimentalTypeInference::class) -fun sequence(@BuilderInference block: suspend Inv.() -> Unit): U = null!! +fun sequence(block: suspend Inv.() -> Unit): U = null!! interface Inv { fun yield(element: T) diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.txt index 6be771d7c72..ff6124d59eb 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.txt @@ -1,7 +1,7 @@ package public fun materialize(): Inv -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun sequence(/*0*/ @kotlin.BuilderInference block: suspend Inv.() -> kotlin.Unit): U +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun sequence(/*0*/ block: suspend Inv.() -> kotlin.Unit): U public fun test_1(): kotlin.Unit public fun test_2(): kotlin.Unit public fun test_3(): kotlin.Unit diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt36202.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt36202.kt index ba8a93c3291..8fca1ca76ab 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt36202.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt36202.kt @@ -7,7 +7,7 @@ import kotlin.experimental.ExperimentalTypeInference interface Build @OptIn(ExperimentalTypeInference::class) -fun build(@BuilderInference fn: Builder.() -> Unit): Build = TODO() +fun build(fn: Builder.() -> Unit): Build = TODO() interface Builder { fun foo(fn: () -> T) diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt36202.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt36202.txt index 9fa7b2a7e97..c77a57cb090 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt36202.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt36202.txt @@ -1,6 +1,6 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ @kotlin.BuilderInference fn: Builder.() -> kotlin.Unit): Build +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun build(/*0*/ fn: Builder.() -> kotlin.Unit): Build public fun main(): kotlin.Unit public interface Build { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt36220.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt36220.kt index 221fdeb0420..d73e674faea 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt36220.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt36220.kt @@ -10,7 +10,7 @@ class TypeDefinition { } @OptIn(ExperimentalTypeInference::class) -fun defineType(@BuilderInference definition: TypeDefinition.() -> Unit): Unit = TODO() +fun defineType(definition: TypeDefinition.() -> Unit): Unit = TODO() fun main() { defineType { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt36220.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt36220.txt index de05b946fc6..8ee9499805c 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt36220.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt36220.txt @@ -1,6 +1,6 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun defineType(/*0*/ @kotlin.BuilderInference definition: TypeDefinition.() -> kotlin.Unit): kotlin.Unit +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun defineType(/*0*/ definition: TypeDefinition.() -> kotlin.Unit): kotlin.Unit public fun main(): kotlin.Unit public final class TypeDefinition { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt38667.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt38667.kt index 2023b82c491..178c5ad03f3 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt38667.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt38667.kt @@ -19,7 +19,7 @@ class TransitionDefinition { fun transition(fromState: T? = null, toState: T? = null, init: TransitionSpec.() -> Unit) {} } @OptIn(ExperimentalTypeInference::class) -fun transitionDefinition(@BuilderInference init: TransitionDefinition.() -> Unit) = TransitionDefinition().apply(init) +fun transitionDefinition(init: TransitionDefinition.() -> Unit) = TransitionDefinition().apply(init) fun main() { val intProp = IntPropKey() diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt38667.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt38667.txt index d36d1fbd985..081c25f6b55 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt38667.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt38667.txt @@ -1,7 +1,7 @@ package public fun main(): kotlin.Unit -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun transitionDefinition(/*0*/ @kotlin.BuilderInference init: TransitionDefinition.() -> kotlin.Unit): TransitionDefinition +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun transitionDefinition(/*0*/ init: TransitionDefinition.() -> kotlin.Unit): TransitionDefinition public abstract class AnimationBuilder { public constructor AnimationBuilder() diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt38766.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt38766.kt index fcc78ff60a1..8d32d5bf4c7 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt38766.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt38766.kt @@ -13,7 +13,7 @@ inline fun emptyFlow(crossinline transform: (Array) -> R): Flo fun flowOf1(value: T): Flow1 = TODO() @OptIn(ExperimentalTypeInference::class) -fun flow1(@BuilderInference block: suspend FlowCollector1.() -> Unit): Flow1 = TODO() +fun flow1(block: suspend FlowCollector1.() -> Unit): Flow1 = TODO() interface FlowCollector1 { suspend fun emit(value: T) diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt38766.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt38766.txt index e5bb97732f6..48a1df25990 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt38766.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt38766.txt @@ -2,7 +2,7 @@ package public inline fun emptyFlow(/*0*/ crossinline transform: (kotlin.Array) -> R): Flow1 public inline fun emptyFlow(/*0*/ crossinline transform: suspend (kotlin.Array) -> R): Flow1 -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun flow1(/*0*/ @kotlin.BuilderInference block: suspend FlowCollector1.() -> kotlin.Unit): Flow1 +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun flow1(/*0*/ block: suspend FlowCollector1.() -> kotlin.Unit): Flow1 public fun flowOf1(/*0*/ value: T): Flow1 public interface Flow1 { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.fir.kt index 2cb456de503..d6e11382b39 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.fir.kt @@ -10,7 +10,7 @@ interface MyFlow fun select(x: K, y: K): K = x @OptIn(ExperimentalTypeInference::class) -fun myCallbackFlow(@BuilderInference block: MyProducerScope.() -> Unit): MyFlow = null!! +fun myCallbackFlow(block: MyProducerScope.() -> Unit): MyFlow = null!! fun MyProducerScope<*>.myAwaitClose(block: () -> Unit = {}) {} fun myEmptyFlow(): MyFlow = null!! diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.kt index 7aadaa1dd5f..c563929de53 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.kt @@ -10,7 +10,7 @@ interface MyFlow fun select(x: K, y: K): K = x @OptIn(ExperimentalTypeInference::class) -fun myCallbackFlow(@BuilderInference block: MyProducerScope.() -> Unit): MyFlow = null!! +fun myCallbackFlow(block: MyProducerScope.() -> Unit): MyFlow = null!! fun MyProducerScope<*>.myAwaitClose(block: () -> Unit = {}) {} fun myEmptyFlow(): MyFlow = null!! diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.txt index 3a88e7890c0..78d5b680cc1 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.txt @@ -1,6 +1,6 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun myCallbackFlow(/*0*/ @kotlin.BuilderInference block: MyProducerScope.() -> kotlin.Unit): MyFlow +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun myCallbackFlow(/*0*/ block: MyProducerScope.() -> kotlin.Unit): MyFlow public fun myEmptyFlow(): MyFlow public fun select(/*0*/ x: K, /*1*/ y: K): K public fun test(): MyFlow diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41396.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41396.kt index e5cfacf8f3e..d50fd756c4b 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41396.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41396.kt @@ -1,7 +1,7 @@ // FIR_IDENTICAL // !DIAGNOSTICS: -OPT_IN_USAGE_ERROR -UNUSED_PARAMETER -CAST_NEVER_SUCCEEDS -fun Flow.transformLatest(@BuilderInference transform: suspend FlowCollector.(value: T) -> Unit) = null as Flow +fun Flow.transformLatest(transform: suspend FlowCollector.(value: T) -> Unit) = null as Flow interface Flow { suspend fun collect(collector: FlowCollector) @@ -11,7 +11,7 @@ interface FlowCollector { suspend fun emit(value: T) } -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit) = null as Flow +fun flow(block: suspend FlowCollector.() -> Unit) = null as Flow fun flowOf(value: T) = null as Flow fun foo() = flow { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41396.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41396.txt index 51c52fb4b71..724f066a067 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41396.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41396.txt @@ -1,9 +1,9 @@ package -public fun flow(/*0*/ @kotlin.BuilderInference block: suspend FlowCollector.() -> kotlin.Unit): Flow +public fun flow(/*0*/ block: suspend FlowCollector.() -> kotlin.Unit): Flow public fun flowOf(/*0*/ value: T): Flow public fun foo(): Flow -public fun Flow.transformLatest(/*0*/ @kotlin.BuilderInference transform: suspend FlowCollector.(value: T) -> kotlin.Unit): Flow +public fun Flow.transformLatest(/*0*/ transform: suspend FlowCollector.(value: T) -> kotlin.Unit): Flow public interface Flow { public abstract suspend fun collect(/*0*/ collector: FlowCollector): kotlin.Unit diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/plusAssignInCoroutineContext.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/plusAssignInCoroutineContext.fir.kt index d7a41dc54df..a388035d628 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/plusAssignInCoroutineContext.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/plusAssignInCoroutineContext.fir.kt @@ -10,7 +10,7 @@ interface FlowCollector { interface Flow -public fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit) = materialize>() +public fun flow(block: suspend FlowCollector.() -> Unit) = materialize>() fun foo(total: Int, next: Int) = 10 fun foo(total: Int, next: Float) = 10 diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/plusAssignInCoroutineContext.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/plusAssignInCoroutineContext.kt index 6a7a1c287d1..c9192379a6d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/plusAssignInCoroutineContext.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/plusAssignInCoroutineContext.kt @@ -10,7 +10,7 @@ interface FlowCollector { interface Flow -public fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit) = materialize>() +public fun flow(block: suspend FlowCollector.() -> Unit) = materialize>() fun foo(total: Int, next: Int) = 10 fun foo(total: Int, next: Float) = 10 diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/plusAssignInCoroutineContext.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/plusAssignInCoroutineContext.txt index 2b5c4d5f111..d63a66fd235 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/plusAssignInCoroutineContext.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/plusAssignInCoroutineContext.txt @@ -1,7 +1,7 @@ package public fun call(/*0*/ x: kotlin.String): kotlin.Unit -public fun flow(/*0*/ @kotlin.BuilderInference block: suspend FlowCollector.() -> kotlin.Unit): Flow +public fun flow(/*0*/ block: suspend FlowCollector.() -> kotlin.Unit): Flow public fun foo(/*0*/ total: kotlin.Float, /*1*/ next: kotlin.Int): kotlin.Int public suspend fun foo(/*0*/ x: kotlin.Int): Flow public fun foo(/*0*/ total: kotlin.Int, /*1*/ next: kotlin.Float): kotlin.Int diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/qualifiedResolvedExpressionInsideBuilderInference.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/qualifiedResolvedExpressionInsideBuilderInference.kt index 5dc9e05dd80..19f4c8072d5 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/qualifiedResolvedExpressionInsideBuilderInference.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/qualifiedResolvedExpressionInsideBuilderInference.kt @@ -12,7 +12,7 @@ fun test() { } @OptIn(ExperimentalTypeInference::class) -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit): Flow = TODO() +fun flow(block: suspend FlowCollector.() -> Unit): Flow = TODO() interface Flow diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/qualifiedResolvedExpressionInsideBuilderInference.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/qualifiedResolvedExpressionInsideBuilderInference.txt index fb5553cbb6e..54c46d4bc21 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/qualifiedResolvedExpressionInsideBuilderInference.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/qualifiedResolvedExpressionInsideBuilderInference.txt @@ -1,6 +1,6 @@ package -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun flow(/*0*/ @kotlin.BuilderInference block: suspend FlowCollector.() -> kotlin.Unit): Flow +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun flow(/*0*/ block: suspend FlowCollector.() -> kotlin.Unit): Flow public fun test(): kotlin.Unit public interface Flow { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators.kt index efa45fcd214..533ec79ce0e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators.kt @@ -10,7 +10,7 @@ class GenericController { suspend fun yield(t: T) {} } -fun generate(@BuilderInference g: suspend GenericController.() -> Unit): List = TODO() +fun generate(g: suspend GenericController.() -> Unit): List = TODO() val test1 = generate { yield(generate { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators.txt index 7ff834cbffd..6018443cfb9 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators.txt @@ -1,7 +1,7 @@ package public val test1: kotlin.collections.List>>> -public fun generate(/*0*/ @kotlin.BuilderInference g: suspend GenericController.() -> kotlin.Unit): kotlin.collections.List +public fun generate(/*0*/ g: suspend GenericController.() -> kotlin.Unit): kotlin.collections.List public final class GenericController { public constructor GenericController() diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators2.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators2.kt index b6fce857fab..f7cec1d1e16 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators2.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators2.kt @@ -11,9 +11,8 @@ class GenericController { suspend fun yield(t: T) {} } -fun generate(@BuilderInference g: suspend GenericController.() -> Unit): List = TODO() +fun generate(g: suspend GenericController.() -> Unit): List = TODO() -@BuilderInference suspend fun GenericController>.yieldGenerate(g: suspend GenericController.() -> Unit): Unit = TODO() val test1 = generate { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators2.ni.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators2.ni.txt index c4c702482ba..337638e04d4 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators2.ni.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators2.ni.txt @@ -1,8 +1,8 @@ package public val test1: kotlin.collections.List> -public fun generate(/*0*/ @kotlin.BuilderInference g: suspend GenericController.() -> kotlin.Unit): kotlin.collections.List -@kotlin.BuilderInference public suspend fun GenericController>.yieldGenerate(/*0*/ g: suspend GenericController.() -> kotlin.Unit): kotlin.Unit +public fun generate(/*0*/ g: suspend GenericController.() -> kotlin.Unit): kotlin.collections.List +public suspend fun GenericController>.yieldGenerate(/*0*/ g: suspend GenericController.() -> kotlin.Unit): kotlin.Unit public final class GenericController { public constructor GenericController() diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators2.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators2.txt index 26da761b461..e12e02c141c 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators2.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators2.txt @@ -1,8 +1,8 @@ package public val test1: kotlin.collections.List -public fun generate(/*0*/ @kotlin.BuilderInference g: suspend GenericController.() -> kotlin.Unit): kotlin.collections.List -@kotlin.BuilderInference public suspend fun GenericController>.yieldGenerate(/*0*/ g: suspend GenericController.() -> kotlin.Unit): kotlin.Unit +public fun generate(/*0*/ g: suspend GenericController.() -> kotlin.Unit): kotlin.collections.List +public suspend fun GenericController>.yieldGenerate(/*0*/ g: suspend GenericController.() -> kotlin.Unit): kotlin.Unit public final class GenericController { public constructor GenericController() diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/returnTypeInference2.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/returnTypeInference2.kt index e661f320d58..6e29dd7a1f3 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/returnTypeInference2.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/returnTypeInference2.kt @@ -10,7 +10,7 @@ class Controller { suspend fun yield(t: T) {} } -fun generate(@BuilderInference g: suspend Controller.() -> R): Pair = TODO() +fun generate(g: suspend Controller.() -> R): Pair = TODO() val test1 = generate { yield("") diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/returnTypeInference2.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/returnTypeInference2.txt index e2ed19c5b55..2682b299a82 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/returnTypeInference2.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/returnTypeInference2.txt @@ -1,7 +1,7 @@ package public val test1: Pair -public fun generate(/*0*/ @kotlin.BuilderInference g: suspend Controller.() -> R): Pair +public fun generate(/*0*/ g: suspend Controller.() -> R): Pair public final class Controller { public constructor Controller() diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/severalCandidatesWithDifferentVisibility.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/severalCandidatesWithDifferentVisibility.kt index a85eff09beb..bc39419851f 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/severalCandidatesWithDifferentVisibility.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/severalCandidatesWithDifferentVisibility.kt @@ -32,7 +32,7 @@ interface Inv { fun emit(e: T) } -fun invBuilder(@BuilderInference block: Inv.() -> Unit) {} +fun invBuilder(block: Inv.() -> Unit) {} fun test() { invBuilder { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/severalCandidatesWithDifferentVisibility.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/severalCandidatesWithDifferentVisibility.txt index 44e74079fa4..285a5099b8f 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/severalCandidatesWithDifferentVisibility.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/severalCandidatesWithDifferentVisibility.txt @@ -31,7 +31,7 @@ package b { } package c { - public fun invBuilder(/*0*/ @kotlin.BuilderInference block: c.Inv.() -> kotlin.Unit): kotlin.Unit + public fun invBuilder(/*0*/ block: c.Inv.() -> kotlin.Unit): kotlin.Unit public fun test(): kotlin.Unit public interface Inv { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/simpleGenerator.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/simpleGenerator.kt index dbe3c71b91c..23aa85c2566 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/simpleGenerator.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/simpleGenerator.kt @@ -12,7 +12,7 @@ class GenericController { suspend fun yieldVararg(vararg t: T) {} } -fun generate(@BuilderInference g: suspend GenericController.() -> Unit): S = TODO() +fun generate(g: suspend GenericController.() -> Unit): S = TODO() val test1 = generate { yield(4) diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/simpleGenerator.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/simpleGenerator.txt index a2fe7f4c928..85d771e19cb 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/simpleGenerator.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/simpleGenerator.txt @@ -4,7 +4,7 @@ public val test1: kotlin.Int public val test2: kotlin.Int public val test3: kotlin.Int public val test4: kotlin.Any -public fun generate(/*0*/ @kotlin.BuilderInference g: suspend GenericController.() -> kotlin.Unit): S +public fun generate(/*0*/ g: suspend GenericController.() -> kotlin.Unit): S public fun setOf(/*0*/ vararg x: X /*kotlin.Array*/): kotlin.collections.Set public final class GenericController { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.fir.kt index d451eb553e1..52615bdeada 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.fir.kt @@ -10,7 +10,7 @@ class Controller { suspend fun yield(t: T) {} } -fun generate(@BuilderInference g: suspend Controller.() -> Unit): S = TODO() +fun generate(g: suspend Controller.() -> Unit): S = TODO() class A diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.kt index 05d6c07d27d..ecc193c2bb1 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.kt @@ -10,7 +10,7 @@ class Controller { suspend fun yield(t: T) {} } -fun generate(@BuilderInference g: suspend Controller.() -> Unit): S = TODO() +fun generate(g: suspend Controller.() -> Unit): S = TODO() class A diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.ni.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.ni.txt index a9e794c6cff..131c32a7016 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.ni.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.ni.txt @@ -4,7 +4,7 @@ public val test1: [Error type: Not found recorded type for generate { yield(A) }] public val test2: kotlin.Int -public fun generate(/*0*/ @kotlin.BuilderInference g: suspend Controller.() -> kotlin.Unit): S +public fun generate(/*0*/ g: suspend Controller.() -> kotlin.Unit): S public final class A { public constructor A() diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.txt index e1c830c8f28..fa1ec20c49a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.txt @@ -4,7 +4,7 @@ public val test1: [ERROR : Type for generate { yield(A) }] public val test2: kotlin.Int -public fun generate(/*0*/ @kotlin.BuilderInference g: suspend Controller.() -> kotlin.Unit): S +public fun generate(/*0*/ g: suspend Controller.() -> kotlin.Unit): S public final class A { public constructor A() diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/twoReceiversInScope.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/twoReceiversInScope.kt index d8045585a56..5f96b79e61d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/twoReceiversInScope.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/twoReceiversInScope.kt @@ -9,13 +9,13 @@ import kotlin.experimental.ExperimentalTypeInference interface MyFlow interface MyFlowCollector -fun flow(@BuilderInference block: MyFlowCollector.() -> Unit): MyFlow = TODO() +fun flow(block: MyFlowCollector.() -> Unit): MyFlow = TODO() interface SendChannel { fun send(element: E) } -fun

produce(@BuilderInference block: SendChannel

.() -> Unit) {} +fun

produce(block: SendChannel

.() -> Unit) {} fun MyFlow.collect(action: (C) -> Unit) {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/twoReceiversInScope.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/twoReceiversInScope.txt index 6b50b41daa0..c0da9c7c766 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/twoReceiversInScope.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/twoReceiversInScope.txt @@ -1,7 +1,7 @@ package -public fun flow(/*0*/ @kotlin.BuilderInference block: MyFlowCollector.() -> kotlin.Unit): MyFlow -public fun produce(/*0*/ @kotlin.BuilderInference block: SendChannel

.() -> kotlin.Unit): kotlin.Unit +public fun flow(/*0*/ block: MyFlowCollector.() -> kotlin.Unit): MyFlow +public fun produce(/*0*/ block: SendChannel

.() -> kotlin.Unit): kotlin.Unit public fun MyFlow.collect(/*0*/ action: (C) -> kotlin.Unit): kotlin.Unit private fun MyFlow.idScoped(): MyFlow diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/typeFromReceiver.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/typeFromReceiver.kt index 218605ddbd3..b424b81d63b 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/typeFromReceiver.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/typeFromReceiver.kt @@ -8,9 +8,8 @@ import kotlin.experimental.ExperimentalTypeInference class GenericController -fun generate(@BuilderInference g: suspend GenericController.() -> Unit): List = TODO() +fun generate(g: suspend GenericController.() -> Unit): List = TODO() -@BuilderInference suspend fun GenericController>.test() {} val test1 = generate { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/typeFromReceiver.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/typeFromReceiver.txt index b2128c4125e..60aaa9dcf70 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/typeFromReceiver.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/typeFromReceiver.txt @@ -1,8 +1,8 @@ package public val test1: kotlin.collections.List> -public fun generate(/*0*/ @kotlin.BuilderInference g: suspend GenericController.() -> kotlin.Unit): kotlin.collections.List -@kotlin.BuilderInference public suspend fun GenericController>.test(): kotlin.Unit +public fun generate(/*0*/ g: suspend GenericController.() -> kotlin.Unit): kotlin.collections.List +public suspend fun GenericController>.test(): kotlin.Unit public final class GenericController { public constructor GenericController() diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/variableCallInsideBuilderFunction.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/variableCallInsideBuilderFunction.kt index ce784995d9b..d0c3ccdbe25 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/variableCallInsideBuilderFunction.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/variableCallInsideBuilderFunction.kt @@ -10,7 +10,7 @@ interface ProducerScope { } @OptIn(ExperimentalTypeInference::class) -fun produce(@BuilderInference block: ProducerScope.() -> Unit): ProducerScope = TODO() +fun produce(block: ProducerScope.() -> Unit): ProducerScope = TODO() fun filter(e: K, predicate: (K) -> Boolean) = produce { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/variableCallInsideBuilderFunction.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/variableCallInsideBuilderFunction.txt index 0ada6c88a4f..4a2d560ce20 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/variableCallInsideBuilderFunction.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/variableCallInsideBuilderFunction.txt @@ -1,7 +1,7 @@ package public fun filter(/*0*/ e: K, /*1*/ predicate: (K) -> kotlin.Boolean): ProducerScope -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun produce(/*0*/ @kotlin.BuilderInference block: ProducerScope.() -> kotlin.Unit): ProducerScope +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun produce(/*0*/ block: ProducerScope.() -> kotlin.Unit): ProducerScope public interface ProducerScope { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/variableOfAFunctionTypeCall.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/variableOfAFunctionTypeCall.kt index 65d93e45012..8d357c35cef 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/variableOfAFunctionTypeCall.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/variableOfAFunctionTypeCall.kt @@ -11,7 +11,7 @@ interface ProducerScope { } @OptIn(ExperimentalTypeInference::class) -fun produce(@BuilderInference block: ProducerScope.() -> Unit): ProducerScope = TODO() +fun produce(block: ProducerScope.() -> Unit): ProducerScope = TODO() fun filter(e: K, predicate: (K) -> Boolean) = produce { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/variableOfAFunctionTypeCall.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/variableOfAFunctionTypeCall.txt index 0ada6c88a4f..4a2d560ce20 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/variableOfAFunctionTypeCall.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/variableOfAFunctionTypeCall.txt @@ -1,7 +1,7 @@ package public fun filter(/*0*/ e: K, /*1*/ predicate: (K) -> kotlin.Boolean): ProducerScope -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun produce(/*0*/ @kotlin.BuilderInference block: ProducerScope.() -> kotlin.Unit): ProducerScope +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun produce(/*0*/ block: ProducerScope.() -> kotlin.Unit): ProducerScope public interface ProducerScope { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/withParameter.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/withParameter.kt index 5a001b9344e..88ee9624a85 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/withParameter.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/withParameter.kt @@ -10,7 +10,7 @@ class GenericController { suspend fun yield(t: T) {} } -fun generate(p1: P1, p2: List, @BuilderInference g: suspend GenericController.(P1, P2) -> R): Four = TODO() +fun generate(p1: P1, p2: List, g: suspend GenericController.(P1, P2) -> R): Four = TODO() val test1 = generate(1, listOf("")) { p1, p2 -> yield(p1) diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/withParameter.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/withParameter.txt index 788daae86fc..3107d162860 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/withParameter.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/withParameter.txt @@ -1,7 +1,7 @@ package public val test1: Four -public fun generate(/*0*/ p1: P1, /*1*/ p2: kotlin.collections.List, /*2*/ @kotlin.BuilderInference g: suspend GenericController.(P1, P2) -> R): Four +public fun generate(/*0*/ p1: P1, /*1*/ p2: kotlin.collections.List, /*2*/ g: suspend GenericController.(P1, P2) -> R): Four public fun listOf(/*0*/ vararg x: X /*kotlin.Array*/): kotlin.collections.List public final class Four { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt28658.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt28658.kt index 64d321de282..8bcd30b41af 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt28658.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt28658.kt @@ -20,7 +20,7 @@ class Foo fun f1(f: Foo.() -> Unit) {} @OptIn(ExperimentalTypeInference::class) -fun f2(@BuilderInference f: Foo.() -> Unit) { +fun f2(f: Foo.() -> Unit) { } fun test3() { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt28658.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt28658.txt index bb57cac859d..e79dca42f61 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt28658.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt28658.txt @@ -1,7 +1,7 @@ package public fun f1(/*0*/ f: Foo.() -> kotlin.Unit): kotlin.Unit -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun f2(/*0*/ @kotlin.BuilderInference f: Foo.() -> kotlin.Unit): kotlin.Unit +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun f2(/*0*/ f: Foo.() -> kotlin.Unit): kotlin.Unit public fun test1(): kotlin.Unit public fun test2(): [Error type: Return type for function cannot be resolved] public fun test3(): kotlin.Unit diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt37309.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt37309.kt index 23555dba723..61da5678675 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt37309.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt37309.kt @@ -5,7 +5,7 @@ import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun myBuildList(@BuilderInference builderAction: MutableList.() -> Unit) { +fun myBuildList(builderAction: MutableList.() -> Unit) { ArrayList().builderAction() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt37309.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt37309.txt index b497685d03c..7f19fff4ec2 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt37309.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt37309.txt @@ -1,7 +1,7 @@ package @kotlin.OptIn(markerClass = {kotlin.ExperimentalStdlibApi::class}) public fun main(): kotlin.Unit -@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun myBuildList(/*0*/ @kotlin.BuilderInference builderAction: kotlin.collections.MutableList.() -> kotlin.Unit): kotlin.Unit +@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun myBuildList(/*0*/ builderAction: kotlin.collections.MutableList.() -> kotlin.Unit): kotlin.Unit public final class Foo { public constructor Foo(/*0*/ notNullProp: kotlin.String) diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_3.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_3.kt index 20fb52755e0..fa08071a136 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_3.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_3.kt @@ -28,9 +28,8 @@ class RestrictedController { } } -fun buildSequence(@BuilderInference c: suspend RestrictedController.() -> Unit) {} +fun buildSequence(c: suspend RestrictedController.() -> Unit) {} -@BuilderInference suspend fun RestrictedController.yield2(x: T) {} fun test() { diff --git a/compiler/testData/ir/irText/expressions/kt47082.ir.txt b/compiler/testData/ir/irText/expressions/kt47082.ir.txt index 0335d77127a..91eb84ddab3 100644 --- a/compiler/testData/ir/irText/expressions/kt47082.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt47082.ir.txt @@ -2,8 +2,6 @@ FILE fqName: fileName:/kt47082.kt FUN name:produce visibility:public modality:FINAL (block:@[ExtensionFunctionType] kotlin.Function1<.Derived.produce>, kotlin.Unit>) returnType:E of .produce TYPE_PARAMETER name:E index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.Function1<.Derived.produce>, kotlin.Unit> - annotations: - BuilderInference BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun produce (block: @[ExtensionFunctionType] kotlin.Function1<.Derived.produce>, kotlin.Unit>): E of .produce declared in ' TYPE_OP type=E of .produce origin=CAST typeOperand=E of .produce diff --git a/compiler/testData/ir/irText/expressions/kt47082.kt b/compiler/testData/ir/irText/expressions/kt47082.kt index 9cc008a651e..8baec8a124e 100644 --- a/compiler/testData/ir/irText/expressions/kt47082.kt +++ b/compiler/testData/ir/irText/expressions/kt47082.kt @@ -5,7 +5,7 @@ import kotlin.experimental.ExperimentalTypeInference -fun produce(@BuilderInference block: Derived.() -> Unit): E = null as E +fun produce(block: Derived.() -> Unit): E = null as E interface Derived : Base diff --git a/compiler/testData/ir/irText/expressions/kt47082.kt.txt b/compiler/testData/ir/irText/expressions/kt47082.kt.txt index 54f5d73be76..05f9d36f9b2 100644 --- a/compiler/testData/ir/irText/expressions/kt47082.kt.txt +++ b/compiler/testData/ir/irText/expressions/kt47082.kt.txt @@ -1,4 +1,4 @@ -fun produce(@BuilderInference block: @ExtensionFunctionType Function1, Unit>): E { +fun produce(block: @ExtensionFunctionType Function1, Unit>): E { return null as E } diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.ir.txt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.ir.txt index e958152e591..e7b31f60b0e 100644 --- a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.ir.txt +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.ir.txt @@ -4,8 +4,6 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:FINAL visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit> - annotations: - BuilderInference BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun scopedFlow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit>): .Flow.scopedFlow> declared in ' CALL 'public final fun flow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit>): .Flow.flow> declared in ' type=.Flow.scopedFlow> origin=null @@ -56,8 +54,6 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:FINAL visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit> [crossinline] - annotations: - BuilderInference BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun unsafeFlow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit>): .Flow.unsafeFlow> [inline] declared in ' CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null @@ -196,8 +192,6 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:FINAL visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit> - annotations: - BuilderInference BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun flow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit>): .Flow.flow> declared in ' CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null @@ -206,8 +200,6 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:FINAL visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, R of .flowScope> - annotations: - BuilderInference BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun flowScope (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, R of .flowScope>): R of .flowScope [suspend] declared in ' CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null @@ -315,8 +307,6 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt TYPE_PARAMETER name:E index:0 variance: superTypes:[kotlin.Any?] reified:false $receiver: VALUE_PARAMETER name: type:.CoroutineScope VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope.produce>, kotlin.Unit> - annotations: - BuilderInference BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun produce (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope.produce>, kotlin.Unit>): .ReceiveChannel.produce> declared in ' CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.kt.txt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.kt.txt index ff9560c7bff..a7b83133498 100644 --- a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.kt.txt +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.kt.txt @@ -1,5 +1,5 @@ @OptIn(markerClass = [ExperimentalTypeInference::class]) -fun scopedFlow(@BuilderInference block: @ExtensionFunctionType SuspendFunction2, Unit>): Flow { +fun scopedFlow(block: @ExtensionFunctionType SuspendFunction2, Unit>): Flow { return flow(block = local suspend fun FlowCollector.() { val collector: FlowCollector = $this$flow flowScope(block = local suspend fun CoroutineScope.() { @@ -22,7 +22,7 @@ suspend fun FlowCollector.invokeSafely(action: @ExtensionFunctionT } @OptIn(markerClass = [ExperimentalTypeInference::class]) -inline fun unsafeFlow(@BuilderInference crossinline block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { +inline fun unsafeFlow(crossinline block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { return TODO() } @@ -84,12 +84,12 @@ class SafeCollector : FlowCollector { } @OptIn(markerClass = [ExperimentalTypeInference::class]) -fun flow(@BuilderInference block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { +fun flow(block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { return TODO() } @OptIn(markerClass = [ExperimentalTypeInference::class]) -suspend fun flowScope(@BuilderInference block: @ExtensionFunctionType SuspendFunction1): R { +suspend fun flowScope(block: @ExtensionFunctionType SuspendFunction1): R { return TODO() } @@ -127,7 +127,7 @@ interface ReceiveChannel { } @OptIn(markerClass = [ExperimentalTypeInference::class]) -fun CoroutineScope.produce(@BuilderInference block: @ExtensionFunctionType SuspendFunction1, Unit>): ReceiveChannel { +fun CoroutineScope.produce(block: @ExtensionFunctionType SuspendFunction1, Unit>): ReceiveChannel { return TODO() } diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.ir.txt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.ir.txt index 321b0684d3f..701391c4d66 100644 --- a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.ir.txt +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.ir.txt @@ -4,8 +4,6 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit> - annotations: - BuilderInference BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun scopedFlow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit>): .Flow.scopedFlow> declared in ' CALL 'public final fun flow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit>): .Flow.flow> declared in ' type=.Flow.scopedFlow> origin=null @@ -56,8 +54,6 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit> [crossinline] - annotations: - BuilderInference BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun unsafeFlow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit>): .Flow.unsafeFlow> [inline] declared in ' CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null @@ -196,8 +192,6 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit> - annotations: - BuilderInference BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun flow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit>): .Flow.flow> declared in ' CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null @@ -206,8 +200,6 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] reified:false VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, R of .flowScope> - annotations: - BuilderInference BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun flowScope (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, R of .flowScope>): R of .flowScope [suspend] declared in ' CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null @@ -315,8 +307,6 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt TYPE_PARAMETER name:E index:0 variance: superTypes:[kotlin.Any?] reified:false $receiver: VALUE_PARAMETER name: type:.CoroutineScope VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope.produce>, kotlin.Unit> - annotations: - BuilderInference BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun produce (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope.produce>, kotlin.Unit>): .ReceiveChannel.produce> declared in ' CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt index eee582f4623..15571b77e17 100644 --- a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt @@ -3,7 +3,7 @@ import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) -fun scopedFlow(@BuilderInference block: suspend CoroutineScope.(FlowCollector) -> Unit): Flow = +fun scopedFlow(block: suspend CoroutineScope.(FlowCollector) -> Unit): Flow = flow { val collector = this flowScope { block(collector) } @@ -22,7 +22,7 @@ suspend fun FlowCollector.invokeSafely( } @OptIn(ExperimentalTypeInference::class) -inline fun unsafeFlow(@BuilderInference crossinline block: suspend FlowCollector.() -> Unit): Flow = TODO() +inline fun unsafeFlow(crossinline block: suspend FlowCollector.() -> Unit): Flow = TODO() @Deprecated(level = DeprecationLevel.HIDDEN, message = "binary compatibility with a version w/o FlowCollector receiver") public fun Flow.onCompletion(action: suspend (cause: Throwable?) -> Unit) = @@ -48,10 +48,10 @@ class SafeCollector constructor( } @OptIn(ExperimentalTypeInference::class) -fun flow(@BuilderInference block: suspend FlowCollector.() -> Unit): Flow = TODO() +fun flow(block: suspend FlowCollector.() -> Unit): Flow = TODO() @OptIn(ExperimentalTypeInference::class) -suspend fun flowScope(@BuilderInference block: suspend CoroutineScope.() -> R): R = TODO() +suspend fun flowScope(block: suspend CoroutineScope.() -> R): R = TODO() suspend inline fun Flow.collect(crossinline action: suspend (value: T) -> Unit) {} @@ -72,7 +72,7 @@ interface ReceiveChannel @OptIn(ExperimentalTypeInference::class) fun CoroutineScope.produce( - @BuilderInference block: suspend ProducerScope.() -> Unit + block: suspend ProducerScope.() -> Unit ): ReceiveChannel = TODO() interface ProducerScope : CoroutineScope, SendChannel { diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt.txt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt.txt index 11ecc0bcc6e..4f7582444dc 100644 --- a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt.txt +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt.txt @@ -1,5 +1,5 @@ @OptIn(markerClass = [ExperimentalTypeInference::class]) -fun scopedFlow(@BuilderInference block: @ExtensionFunctionType SuspendFunction2, Unit>): Flow { +fun scopedFlow(block: @ExtensionFunctionType SuspendFunction2, Unit>): Flow { return flow(block = local suspend fun FlowCollector.() { val collector: FlowCollector = $this$flow flowScope(block = local suspend fun CoroutineScope.() { @@ -22,7 +22,7 @@ suspend fun FlowCollector.invokeSafely(action: @ExtensionFunctionT } @OptIn(markerClass = [ExperimentalTypeInference::class]) -inline fun unsafeFlow(@BuilderInference crossinline block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { +inline fun unsafeFlow(crossinline block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { return TODO() } @@ -84,12 +84,12 @@ class SafeCollector : FlowCollector { } @OptIn(markerClass = [ExperimentalTypeInference::class]) -fun flow(@BuilderInference block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { +fun flow(block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { return TODO() } @OptIn(markerClass = [ExperimentalTypeInference::class]) -suspend fun flowScope(@BuilderInference block: @ExtensionFunctionType SuspendFunction1): R { +suspend fun flowScope(block: @ExtensionFunctionType SuspendFunction1): R { return TODO() } @@ -127,7 +127,7 @@ interface ReceiveChannel { } @OptIn(markerClass = [ExperimentalTypeInference::class]) -fun CoroutineScope.produce(@BuilderInference block: @ExtensionFunctionType SuspendFunction1, Unit>): ReceiveChannel { +fun CoroutineScope.produce(block: @ExtensionFunctionType SuspendFunction1, Unit>): ReceiveChannel { return TODO() } diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index f579a6f6aa3..33b324724e4 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -18923,6 +18923,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/inference/builderInferenceLeakingVariable.kt"); } + @Test + @TestMetadata("builderInferenceWithAnnotation.kt") + public void testBuilderInferenceWithAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/inference/builderInferenceWithAnnotation.kt"); + } + @Test @TestMetadata("capturedStarProjection.kt") public void testCapturedStarProjection() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 53a9993eee5..52d88c35f3e 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -19397,6 +19397,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/inference/builderInferenceLeakingVariable.kt"); } + @Test + @TestMetadata("builderInferenceWithAnnotation.kt") + public void testBuilderInferenceWithAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/inference/builderInferenceWithAnnotation.kt"); + } + @Test @TestMetadata("capturedStarProjection.kt") public void testCapturedStarProjection() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 48fb4ac18d8..44ce08ef38b 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -15743,6 +15743,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/inference/builderInferenceLeakingVariable.kt"); } + @TestMetadata("builderInferenceWithAnnotation.kt") + public void testBuilderInferenceWithAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/inference/builderInferenceWithAnnotation.kt"); + } + @TestMetadata("capturedStarProjection.kt") public void testCapturedStarProjection() throws Exception { runTest("compiler/testData/codegen/box/inference/capturedStarProjection.kt");