From 14818a4fc12fe7455f3ee824c14d31106209846c Mon Sep 17 00:00:00 2001 From: Ilmir Usmanov Date: Mon, 17 Sep 2018 18:02:15 +0300 Subject: [PATCH] Minor. Remove tests with suspend delegates --- ...alDelegatedPropertyWithSuspendOperators.kt | 27 ---- ...lDelegatedPropertyWithSuspendOperators.txt | 127 ------------------ .../kotlin/ir/IrTextTestCaseGenerated.java | 5 - 3 files changed, 159 deletions(-) delete mode 100644 compiler/testData/ir/irText/declarations/localDelegatedPropertyWithSuspendOperators.kt delete mode 100644 compiler/testData/ir/irText/declarations/localDelegatedPropertyWithSuspendOperators.txt diff --git a/compiler/testData/ir/irText/declarations/localDelegatedPropertyWithSuspendOperators.kt b/compiler/testData/ir/irText/declarations/localDelegatedPropertyWithSuspendOperators.kt deleted file mode 100644 index 5a8f387e6f7..00000000000 --- a/compiler/testData/ir/irText/declarations/localDelegatedPropertyWithSuspendOperators.kt +++ /dev/null @@ -1,27 +0,0 @@ -// WITH_RUNTIME - -import kotlin.coroutines.experimental.intrinsics.COROUTINE_SUSPENDED -import kotlin.coroutines.experimental.intrinsics.suspendCoroutineOrReturn -import kotlin.reflect.KProperty - -class A { - var z: Int = 42 - - operator suspend fun getValue(thisRef: Any?, property: KProperty<*>) = z - - operator suspend fun setValue(thisRef: Any?, property: KProperty<*>, value: Int): Unit = suspendCoroutineOrReturn { x -> - z = value - x.resume(Unit) - COROUTINE_SUSPENDED - } - - operator suspend fun provideDelegate(host: Any?, p: Any): A = suspendCoroutineOrReturn { x -> - x.resume(this) - COROUTINE_SUSPENDED - } -} - -suspend fun test() { - val testVal by A() - var testVar by A() -} \ No newline at end of file diff --git a/compiler/testData/ir/irText/declarations/localDelegatedPropertyWithSuspendOperators.txt b/compiler/testData/ir/irText/declarations/localDelegatedPropertyWithSuspendOperators.txt deleted file mode 100644 index 0d542902109..00000000000 --- a/compiler/testData/ir/irText/declarations/localDelegatedPropertyWithSuspendOperators.txt +++ /dev/null @@ -1,127 +0,0 @@ -FILE fqName: fileName:/localDelegatedPropertyWithSuspendOperators.kt - CLASS CLASS name:A modality:FINAL visibility:public flags: superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:A flags: - CONSTRUCTOR visibility:public <> () returnType:A flags:primary - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'constructor Any()' - INSTANCE_INITIALIZER_CALL classDescriptor='A' - PROPERTY name:z visibility:public modality:FINAL flags:var - FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Int visibility:public flags: - EXPRESSION_BODY - CONST Int type=kotlin.Int value=42 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:A) returnType:kotlin.Int flags: - correspondingProperty: PROPERTY name:z visibility:public modality:FINAL flags:var - $this: VALUE_PARAMETER name: type:A flags: - BLOCK_BODY - RETURN type=kotlin.Nothing from='(): Int' - GET_FIELD 'z: Int' type=kotlin.Int origin=null - receiver: GET_VAR 'this@A: A' type=A origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:A, :kotlin.Int) returnType:kotlin.Unit flags: - correspondingProperty: PROPERTY name:z visibility:public modality:FINAL flags:var - $this: VALUE_PARAMETER name: type:A flags: - VALUE_PARAMETER name: index:0 type:kotlin.Int flags: - BLOCK_BODY - SET_FIELD 'z: Int' type=kotlin.Unit origin=null - receiver: GET_VAR 'this@A: A' type=A origin=null - value: GET_VAR 'value-parameter : Int' type=kotlin.Int origin=null - FUN name:getValue visibility:public modality:FINAL <> ($this:A, thisRef:kotlin.Any?, property:kotlin.reflect.KProperty<*>) returnType:kotlin.Int flags:suspend - $this: VALUE_PARAMETER name: type:A flags: - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? flags: - VALUE_PARAMETER name:property index:1 type:kotlin.reflect.KProperty<*> flags: - BLOCK_BODY - RETURN type=kotlin.Nothing from='getValue(Any?, KProperty<*>): Int' - CALL '(): Int' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'this@A: A' type=A origin=null - FUN name:setValue visibility:public modality:FINAL <> ($this:A, thisRef:kotlin.Any?, property:kotlin.reflect.KProperty<*>, value:kotlin.Int) returnType:kotlin.Unit flags:suspend - $this: VALUE_PARAMETER name: type:A flags: - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? flags: - VALUE_PARAMETER name:property index:1 type:kotlin.reflect.KProperty<*> flags: - VALUE_PARAMETER name:value index:2 type:kotlin.Int flags: - BLOCK_BODY - RETURN type=kotlin.Nothing from='setValue(Any?, KProperty<*>, Int): Unit' - TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - typeOperand: CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public flags: superTypes:[kotlin.Any] - CALL 'suspendCoroutineOrReturn(crossinline (Continuation) -> Any?): Unit' type=kotlin.Unit origin=null - : kotlin.Unit - block: BLOCK type=(kotlin.coroutines.experimental.Continuation) -> kotlin.Any origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (x:kotlin.coroutines.experimental.Continuation) returnType:kotlin.Any flags: - VALUE_PARAMETER name:x index:0 type:kotlin.coroutines.experimental.Continuation flags: - BLOCK_BODY - CALL '(Int): Unit' type=kotlin.Unit origin=EQ - $this: GET_VAR 'this@A: A' type=A origin=null - : GET_VAR 'value-parameter value: Int' type=kotlin.Int origin=null - CALL 'resume(Unit): Unit' type=kotlin.Unit origin=null - $this: GET_VAR 'value-parameter x: Continuation' type=kotlin.coroutines.experimental.Continuation origin=null - value: GET_OBJECT 'Unit' type=kotlin.Unit - RETURN type=kotlin.Nothing from='(Continuation): Any' - CALL '(): Any' type=kotlin.Any origin=GET_PROPERTY - FUNCTION_REFERENCE '(Continuation): Any' type=(kotlin.coroutines.experimental.Continuation) -> kotlin.Any origin=LAMBDA - FUN name:provideDelegate visibility:public modality:FINAL <> ($this:A, host:kotlin.Any?, p:kotlin.Any) returnType:A flags:suspend - $this: VALUE_PARAMETER name: type:A flags: - VALUE_PARAMETER name:host index:0 type:kotlin.Any? flags: - VALUE_PARAMETER name:p index:1 type:kotlin.Any flags: - BLOCK_BODY - RETURN type=kotlin.Nothing from='provideDelegate(Any?, Any): A' - CALL 'suspendCoroutineOrReturn(crossinline (Continuation) -> Any?): A' type=A origin=null - : A - block: BLOCK type=(kotlin.coroutines.experimental.Continuation) -> kotlin.Any origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (x:kotlin.coroutines.experimental.Continuation) returnType:kotlin.Any flags: - VALUE_PARAMETER name:x index:0 type:kotlin.coroutines.experimental.Continuation flags: - BLOCK_BODY - CALL 'resume(A): Unit' type=kotlin.Unit origin=null - $this: GET_VAR 'value-parameter x: Continuation' type=kotlin.coroutines.experimental.Continuation origin=null - value: GET_VAR 'this@A: A' type=A origin=null - RETURN type=kotlin.Nothing from='(Continuation): Any' - CALL '(): Any' type=kotlin.Any origin=GET_PROPERTY - FUNCTION_REFERENCE '(Continuation): Any' type=(kotlin.coroutines.experimental.Continuation) -> kotlin.Any origin=LAMBDA - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean flags: - overridden: - FUN IR_EXTERNAL_DECLARATION_STUB name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean flags: - $this: VALUE_PARAMETER name: type:kotlin.Any flags: - VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags: - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int flags: - overridden: - FUN IR_EXTERNAL_DECLARATION_STUB name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int flags: - $this: VALUE_PARAMETER name: type:kotlin.Any flags: - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String flags: - overridden: - FUN IR_EXTERNAL_DECLARATION_STUB name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String flags: - $this: VALUE_PARAMETER name: type:kotlin.Any flags: - FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit flags:suspend - BLOCK_BODY - LOCAL_DELEGATED_PROPERTY name:testVal type:kotlin.Int flags:val - VAR DELEGATE name:testVal$delegate type:A flags:val - CALL 'provideDelegate(Any?, Any): A' type=A origin=null - $this: CALL 'constructor A()' type=A origin=null - host: CONST Null type=kotlin.Nothing? value=null - p: LOCAL_DELEGATED_PROPERTY_REFERENCE 'testVal: Int' delegate='`testVal$delegate`: A' getter='(): Int' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:local modality:FINAL <> () returnType:kotlin.Int flags:suspend - BLOCK_BODY - RETURN type=kotlin.Nothing from='(): Int' - CALL 'getValue(Any?, KProperty<*>): Int' type=kotlin.Int origin=null - $this: GET_VAR '`testVal$delegate`: A' type=A origin=null - thisRef: CONST Null type=kotlin.Nothing? value=null - property: LOCAL_DELEGATED_PROPERTY_REFERENCE 'testVal: Int' delegate='`testVal$delegate`: A' getter='(): Int' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE - LOCAL_DELEGATED_PROPERTY name:testVar type:kotlin.Int flags:var - VAR DELEGATE name:testVar$delegate type:A flags:val - CALL 'provideDelegate(Any?, Any): A' type=A origin=null - $this: CALL 'constructor A()' type=A origin=null - host: CONST Null type=kotlin.Nothing? value=null - p: LOCAL_DELEGATED_PROPERTY_REFERENCE 'testVar: Int' delegate='`testVar$delegate`: A' getter='(): Int' setter='(Int): Unit' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:local modality:FINAL <> () returnType:kotlin.Int flags:suspend - BLOCK_BODY - RETURN type=kotlin.Nothing from='(): Int' - CALL 'getValue(Any?, KProperty<*>): Int' type=kotlin.Int origin=null - $this: GET_VAR '`testVar$delegate`: A' type=A origin=null - thisRef: CONST Null type=kotlin.Nothing? value=null - property: LOCAL_DELEGATED_PROPERTY_REFERENCE 'testVar: Int' delegate='`testVar$delegate`: A' getter='(): Int' setter='(Int): Unit' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:local modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit flags:suspend - VALUE_PARAMETER name:value index:0 type:kotlin.Int flags: - BLOCK_BODY - RETURN type=kotlin.Nothing from='(Int): Unit' - CALL 'setValue(Any?, KProperty<*>, Int): Unit' type=kotlin.Unit origin=null - $this: GET_VAR '`testVar$delegate`: A' type=A origin=null - thisRef: CONST Null type=kotlin.Nothing? value=null - property: LOCAL_DELEGATED_PROPERTY_REFERENCE 'testVar: Int' delegate='`testVar$delegate`: A' getter='(): Int' setter='(Int): Unit' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE - value: GET_VAR 'value-parameter value: Int' type=kotlin.Int origin=null - diff --git a/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java b/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java index 2b7e31b1bb4..75010943ca0 100644 --- a/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java @@ -269,11 +269,6 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase { runTest("compiler/testData/ir/irText/declarations/localDelegatedProperties.kt"); } - @TestMetadata("localDelegatedPropertyWithSuspendOperators.kt") - public void testLocalDelegatedPropertyWithSuspendOperators() throws Exception { - runTest("compiler/testData/ir/irText/declarations/localDelegatedPropertyWithSuspendOperators.kt"); - } - @TestMetadata("localVarInDoWhile.kt") public void testLocalVarInDoWhile() throws Exception { runTest("compiler/testData/ir/irText/declarations/localVarInDoWhile.kt");