From a34a311e86b84d2815174e3994740ddcc64a8968 Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Wed, 11 Nov 2020 14:18:51 +0300 Subject: [PATCH] [IR] update testdata: support annotations on parameters --- .../delegatedImplementationOfJavaInterface.kt.txt | 8 ++++---- .../delegatedPropertyAccessorsWithAnnotations.kt.txt | 2 +- ...primaryConstructorParameterWithAnnotations.kt.txt | 2 +- .../valueParametersWithAnnotations.kt.txt | 4 ++-- .../signedToUnsignedConversions_test.kt.txt | 12 ++++++------ .../types/castsInsideCoroutineInference.kt.txt | 10 +++++----- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.kt.txt b/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.kt.txt index 8a6c8b57f54..020745b2374 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.kt.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.kt.txt @@ -9,12 +9,12 @@ class Test : J { field = j private get - @NotNull() + @NotNull override fun returnNotNull(): @EnhancedNullability String { return .#j.returnNotNull() } - @Nullable() + @Nullable override fun returnNullable(): @EnhancedNullability String? { return .#j.returnNullable() } @@ -27,11 +27,11 @@ class Test : J { .#j.takeFlexible(x = x) } - override fun takeNotNull(x: @EnhancedNullability String) { + override fun takeNotNull(@NotNull x: @EnhancedNullability String) { .#j.takeNotNull(x = x) } - override fun takeNullable(x: @EnhancedNullability String?) { + override fun takeNullable(@Nullable x: @EnhancedNullability String?) { .#j.takeNullable(x = x) } diff --git a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.kt.txt b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.kt.txt index f41515d8c15..003b6d66c2c 100644 --- a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.kt.txt @@ -42,7 +42,7 @@ var test2: Int /* by */ return #test2$delegate.getValue(thisRef = null, kProp = ::test2) } @A(x = "test2.set") - set(: Int) { + set(@A(x = "test2.set.param") : Int) { return #test2$delegate.setValue(thisRef = null, kProp = ::test2, newValue = ) } diff --git a/compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.kt.txt b/compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.kt.txt index 05dc5755fca..314dca9738d 100644 --- a/compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.kt.txt @@ -4,7 +4,7 @@ annotation class Ann : Annotation { } class Test { - constructor(x: Int) /* primary */ { + constructor(@Ann x: Int) /* primary */ { super/*Any*/() /* () */ diff --git a/compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.kt.txt b/compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.kt.txt index 13caad3c889..14e455635e8 100644 --- a/compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.kt.txt @@ -6,11 +6,11 @@ annotation class TestAnn : Annotation { } -fun testFun(x: Int) { +fun testFun(@TestAnn(x = "testFun.x") x: Int) { } class TestClassConstructor1 { - constructor(x: Int) /* primary */ { + constructor(@TestAnn(x = "TestClassConstructor1.x") x: Int) /* primary */ { super/*Any*/() /* () */ diff --git a/compiler/testData/ir/irText/expressions/signedToUnsignedConversions_test.kt.txt b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions_test.kt.txt index ed290218075..5f4f54b6c20 100644 --- a/compiler/testData/ir/irText/expressions/signedToUnsignedConversions_test.kt.txt +++ b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions_test.kt.txt @@ -28,22 +28,22 @@ const val UINT_CONST: UInt field = 42 get -fun takeUByte(u: UByte) { +fun takeUByte(@ImplicitIntegerCoercion u: UByte) { } -fun takeUShort(u: UShort) { +fun takeUShort(@ImplicitIntegerCoercion u: UShort) { } -fun takeUInt(u: UInt) { +fun takeUInt(@ImplicitIntegerCoercion u: UInt) { } -fun takeULong(u: ULong) { +fun takeULong(@ImplicitIntegerCoercion u: ULong) { } -fun takeUBytes(vararg u: UByte) { +fun takeUBytes(@ImplicitIntegerCoercion vararg u: UByte) { } -fun takeLong(l: Long) { +fun takeLong(@ImplicitIntegerCoercion l: Long) { } fun test() { diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt.txt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt.txt index e52daf75512..2b7ad916436 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(block: @ExtensionFunctionType SuspendFunction2, Unit>): Flow { +fun scopedFlow(@BuilderInference block: @ExtensionFunctionType SuspendFunction2, Unit>): Flow { return flow(block = local suspend fun FlowCollector.() { val collector: FlowCollector = flowScope(block = local suspend fun CoroutineScope.() { @@ -22,7 +22,7 @@ suspend fun FlowCollector.invokeSafely(action: @ExtensionFunctionT } @OptIn(markerClass = [ExperimentalTypeInference::class]) -inline fun unsafeFlow(crossinline block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { +inline fun unsafeFlow(@BuilderInference crossinline block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { TODO() } @@ -84,12 +84,12 @@ class SafeCollector : FlowCollector { } @OptIn(markerClass = [ExperimentalTypeInference::class]) -fun flow(block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { +fun flow(@BuilderInference block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { TODO() } @OptIn(markerClass = [ExperimentalTypeInference::class]) -suspend fun flowScope(block: @ExtensionFunctionType SuspendFunction1): R { +suspend fun flowScope(@BuilderInference block: @ExtensionFunctionType SuspendFunction1): R { TODO() } @@ -127,7 +127,7 @@ interface ReceiveChannel { } @OptIn(markerClass = [ExperimentalTypeInference::class]) -fun CoroutineScope.produce(block: @ExtensionFunctionType SuspendFunction1, Unit>): ReceiveChannel { +fun CoroutineScope.produce(@BuilderInference block: @ExtensionFunctionType SuspendFunction1, Unit>): ReceiveChannel { TODO() }