Minor. Remove tests with suspend delegates
This commit is contained in:
-27
@@ -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()
|
|
||||||
}
|
|
||||||
-127
@@ -1,127 +0,0 @@
|
|||||||
FILE fqName:<root> fileName:/localDelegatedPropertyWithSuspendOperators.kt
|
|
||||||
CLASS CLASS name:A modality:FINAL visibility:public flags: superTypes:[kotlin.Any]
|
|
||||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> 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:<get-z> visibility:public modality:FINAL <> ($this:A) returnType:kotlin.Int flags:
|
|
||||||
correspondingProperty: PROPERTY name:z visibility:public modality:FINAL flags:var
|
|
||||||
$this: VALUE_PARAMETER name:<this> type:A flags:
|
|
||||||
BLOCK_BODY
|
|
||||||
RETURN type=kotlin.Nothing from='<get-z>(): 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:<set-z> visibility:public modality:FINAL <> ($this:A, <set-?>:kotlin.Int) returnType:kotlin.Unit flags:
|
|
||||||
correspondingProperty: PROPERTY name:z visibility:public modality:FINAL flags:var
|
|
||||||
$this: VALUE_PARAMETER name:<this> type:A flags:
|
|
||||||
VALUE_PARAMETER name:<set-?> 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 <set-?>: 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:<this> 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 '<get-z>(): 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:<this> 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<Unit>) -> Any?): Unit' type=kotlin.Unit origin=null
|
|
||||||
<T>: kotlin.Unit
|
|
||||||
block: BLOCK type=(kotlin.coroutines.experimental.Continuation<kotlin.Unit>) -> kotlin.Any origin=LAMBDA
|
|
||||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (x:kotlin.coroutines.experimental.Continuation<kotlin.Unit>) returnType:kotlin.Any flags:
|
|
||||||
VALUE_PARAMETER name:x index:0 type:kotlin.coroutines.experimental.Continuation<kotlin.Unit> flags:
|
|
||||||
BLOCK_BODY
|
|
||||||
CALL '<set-z>(Int): Unit' type=kotlin.Unit origin=EQ
|
|
||||||
$this: GET_VAR 'this@A: A' type=A origin=null
|
|
||||||
<set-?>: 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<Unit>' type=kotlin.coroutines.experimental.Continuation<kotlin.Unit> origin=null
|
|
||||||
value: GET_OBJECT 'Unit' type=kotlin.Unit
|
|
||||||
RETURN type=kotlin.Nothing from='<anonymous>(Continuation<Unit>): Any'
|
|
||||||
CALL '<get-COROUTINE_SUSPENDED>(): Any' type=kotlin.Any origin=GET_PROPERTY
|
|
||||||
FUNCTION_REFERENCE '<anonymous>(Continuation<Unit>): Any' type=(kotlin.coroutines.experimental.Continuation<kotlin.Unit>) -> 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:<this> 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<A>) -> Any?): A' type=A origin=null
|
|
||||||
<T>: A
|
|
||||||
block: BLOCK type=(kotlin.coroutines.experimental.Continuation<A>) -> kotlin.Any origin=LAMBDA
|
|
||||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (x:kotlin.coroutines.experimental.Continuation<A>) returnType:kotlin.Any flags:
|
|
||||||
VALUE_PARAMETER name:x index:0 type:kotlin.coroutines.experimental.Continuation<A> flags:
|
|
||||||
BLOCK_BODY
|
|
||||||
CALL 'resume(A): Unit' type=kotlin.Unit origin=null
|
|
||||||
$this: GET_VAR 'value-parameter x: Continuation<A>' type=kotlin.coroutines.experimental.Continuation<A> origin=null
|
|
||||||
value: GET_VAR 'this@A: A' type=A origin=null
|
|
||||||
RETURN type=kotlin.Nothing from='<anonymous>(Continuation<A>): Any'
|
|
||||||
CALL '<get-COROUTINE_SUSPENDED>(): Any' type=kotlin.Any origin=GET_PROPERTY
|
|
||||||
FUNCTION_REFERENCE '<anonymous>(Continuation<A>): Any' type=(kotlin.coroutines.experimental.Continuation<A>) -> 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:<this> 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:<this> 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:<this> 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='<get-testVal>(): Int' setter=null type=kotlin.reflect.KProperty0<kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
|
|
||||||
FUN DELEGATED_PROPERTY_ACCESSOR name:<get-testVal> visibility:local modality:FINAL <> () returnType:kotlin.Int flags:suspend
|
|
||||||
BLOCK_BODY
|
|
||||||
RETURN type=kotlin.Nothing from='<get-testVal>(): 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='<get-testVal>(): Int' setter=null type=kotlin.reflect.KProperty0<kotlin.Int> 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='<get-testVar>(): Int' setter='<set-testVar>(Int): Unit' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
|
|
||||||
FUN DELEGATED_PROPERTY_ACCESSOR name:<get-testVar> visibility:local modality:FINAL <> () returnType:kotlin.Int flags:suspend
|
|
||||||
BLOCK_BODY
|
|
||||||
RETURN type=kotlin.Nothing from='<get-testVar>(): 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='<get-testVar>(): Int' setter='<set-testVar>(Int): Unit' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
|
|
||||||
FUN DELEGATED_PROPERTY_ACCESSOR name:<set-testVar> 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='<set-testVar>(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='<get-testVar>(): Int' setter='<set-testVar>(Int): Unit' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
|
|
||||||
value: GET_VAR 'value-parameter value: Int' type=kotlin.Int origin=null
|
|
||||||
|
|
||||||
@@ -269,11 +269,6 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
|
|||||||
runTest("compiler/testData/ir/irText/declarations/localDelegatedProperties.kt");
|
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")
|
@TestMetadata("localVarInDoWhile.kt")
|
||||||
public void testLocalVarInDoWhile() throws Exception {
|
public void testLocalVarInDoWhile() throws Exception {
|
||||||
runTest("compiler/testData/ir/irText/declarations/localVarInDoWhile.kt");
|
runTest("compiler/testData/ir/irText/declarations/localVarInDoWhile.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user