From 0b3048f60a9126e98db8b64e45d3d34e99d84d0c Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Wed, 4 Jul 2018 18:41:01 +0300 Subject: [PATCH] Replace trivial usages of suspendCoroutineOrReturn in tests This is necessary since suspendCoroutineOrReturn gets removed in 1.3 --- .../capturedVarsOptimization/withCoroutines.kt | 2 +- .../coroutines/32defaultParametersInSuspend.kt | 2 +- .../box/coroutines/accessorForSuspend.kt | 2 +- .../codegen/box/coroutines/asyncIterator.kt | 6 +++--- .../box/coroutines/asyncIteratorNullMerge.kt | 6 +++--- .../box/coroutines/asyncIteratorToList.kt | 6 +++--- .../box/coroutines/beginWithException.kt | 2 +- .../beginWithExceptionNoHandleException.kt | 2 +- .../codegen/box/coroutines/coercionToUnit.kt | 2 +- .../box/coroutines/controlFlow/breakFinally.kt | 2 +- .../coroutines/controlFlow/breakStatement.kt | 2 +- .../coroutines/controlFlow/doWhileStatement.kt | 2 +- .../box/coroutines/controlFlow/forContinue.kt | 2 +- .../box/coroutines/controlFlow/forStatement.kt | 2 +- .../box/coroutines/controlFlow/forWithStep.kt | 2 +- .../box/coroutines/controlFlow/ifStatement.kt | 2 +- .../box/coroutines/controlFlow/labeledWhile.kt | 2 +- .../controlFlow/returnFromFinally.kt | 2 +- .../coroutines/controlFlow/switchLikeWhen.kt | 2 +- .../coroutines/controlFlow/throwFromCatch.kt | 4 ++-- .../controlFlow/throwInTryWithHandleResult.kt | 2 +- .../coroutines/controlFlow/whileStatement.kt | 2 +- .../controllerAccessFromInnerLambda.kt | 2 +- .../box/coroutines/coroutineToString.kt | 2 +- .../box/coroutines/coroutineToString_1_2.kt | 2 +- .../coroutines/defaultParametersInSuspend.kt | 2 +- .../codegen/box/coroutines/emptyClosure.kt | 2 +- .../box/coroutines/falseUnitCoercion.kt | 2 +- .../breakWithNonEmptyStack.kt | 2 +- .../callableReference/longArgs.kt | 4 ++-- .../safeCallOnTwoReceivers.kt | 2 +- .../safeCallOnTwoReceiversLong.kt | 2 +- .../suspendDestructuringInLambdas.kt | 2 +- .../featureIntersection/suspendOperatorPlus.kt | 4 ++-- .../suspendOperatorPlusAssign.kt | 4 ++-- .../suspendOperatorPlusCallFromLambda.kt | 2 +- .../featureIntersection/tailrec/extention.kt | 2 +- .../codegen/box/coroutines/generate.kt | 2 +- .../codegen/box/coroutines/handleException.kt | 4 ++-- .../handleResultNonUnitExpression.kt | 2 +- .../box/coroutines/handleResultSuspended.kt | 2 +- .../codegen/box/coroutines/illegalState.kt | 2 +- .../codegen/box/coroutines/illegalState_1_2.kt | 2 +- .../box/coroutines/inlineFunInGenericClass.kt | 2 +- .../inlineGenericFunCalledFromSubclass.kt | 2 +- .../box/coroutines/inlineSuspendFunction.kt | 2 +- .../box/coroutines/inlinedTryCatchFinally.kt | 4 ++-- .../box/coroutines/innerSuspensionCalls.kt | 2 +- .../box/coroutines/instanceOfContinuation.kt | 4 ++-- .../intLikeVarSpilling/complicatedMerge.kt | 2 +- .../coroutines/intLikeVarSpilling/i2bResult.kt | 2 +- .../intLikeVarSpilling/loadFromBooleanArray.kt | 2 +- .../intLikeVarSpilling/loadFromByteArray.kt | 2 +- .../intLikeVarSpilling/noVariableInTable.kt | 2 +- .../intLikeVarSpilling/sameIconst1ManyVars.kt | 2 +- .../intLikeVarSpilling/usedInArrayStore.kt | 2 +- .../intLikeVarSpilling/usedInMethodCall.kt | 2 +- .../intLikeVarSpilling/usedInPutfield.kt | 2 +- .../intLikeVarSpilling/usedInVarStore.kt | 2 +- .../intrinsicSemantics/startCoroutine.kt | 4 ++-- .../startCoroutineUninterceptedOrReturn.kt | 4 ++-- .../codegen/box/coroutines/iterateOverArray.kt | 2 +- .../testData/codegen/box/coroutines/kt12958.kt | 2 +- .../testData/codegen/box/coroutines/kt15016.kt | 4 ++-- .../testData/codegen/box/coroutines/kt15930.kt | 4 ++-- .../box/coroutines/lastExpressionIsLoop.kt | 2 +- .../codegen/box/coroutines/lastStatementInc.kt | 2 +- .../box/coroutines/lastStementAssignment.kt | 2 +- .../box/coroutines/lastUnitExpression.kt | 2 +- .../codegen/box/coroutines/localCallableRef.kt | 2 +- .../codegen/box/coroutines/localDelegate.kt | 4 ++-- .../localFunctions/named/capturedParameters.kt | 2 +- .../localFunctions/named/capturedVariables.kt | 2 +- .../localFunctions/named/extension.kt | 2 +- .../coroutines/localFunctions/named/infix.kt | 2 +- .../localFunctions/named/insideLambda.kt | 2 +- .../named/simpleSuspensionPoint.kt | 2 +- .../localFunctions/named/withArguments.kt | 2 +- .../box/coroutines/longRangeInSuspendCall.kt | 4 ++-- .../box/coroutines/longRangeInSuspendFun.kt | 2 +- .../box/coroutines/mergeNullAndString.kt | 2 +- .../multiModule/inlineMultiModule.kt | 2 +- .../multiModule/inlineMultiModuleOverride.kt | 2 +- .../inlineMultiModuleWithController.kt | 2 +- .../inlineMultiModuleWithInnerInlining.kt | 2 +- .../box/coroutines/multiModule/simple.kt | 2 +- .../box/coroutines/multipleInvokeCalls.kt | 2 +- .../multipleInvokeCallsInsideInlineLambda1.kt | 2 +- .../multipleInvokeCallsInsideInlineLambda2.kt | 2 +- .../multipleInvokeCallsInsideInlineLambda3.kt | 2 +- .../codegen/box/coroutines/nestedTryCatch.kt | 4 ++-- .../nonLocalReturnFromInlineLambda.kt | 2 +- .../nonLocalReturnFromInlineLambdaDeep.kt | 2 +- .../codegen/box/coroutines/recursiveSuspend.kt | 2 +- .../codegen/box/coroutines/returnByLabel.kt | 2 +- .../testData/codegen/box/coroutines/simple.kt | 2 +- .../codegen/box/coroutines/simpleException.kt | 2 +- .../box/coroutines/simpleWithHandleResult.kt | 2 +- .../stackUnwinding/suspendInCycle.kt | 4 ++-- .../coroutines/statementLikeLastExpression.kt | 2 +- .../suspendCoroutineFromStateMachine.kt | 6 +++--- .../box/coroutines/suspendDefaultImpl.kt | 2 +- .../box/coroutines/suspendDelegation.kt | 2 +- .../box/coroutines/suspendFromInlineLambda.kt | 2 +- .../coroutines/suspendFunImportedFromObject.kt | 2 +- .../handleException.kt | 6 +++--- .../suspendFunctionAsCoroutine/inline.kt | 2 +- .../inlineTwoReceivers.kt | 4 ++-- .../suspendFunctionAsCoroutine/member.kt | 2 +- .../noinlineTwoReceivers.kt | 4 ++-- .../openFunWithJava.kt | 2 +- .../openFunWithJava_1_2.kt | 2 +- .../suspendFunctionAsCoroutine/operators.kt | 18 +++++++++--------- .../privateFunctions.kt | 2 +- .../privateInFile.kt | 2 +- .../returnNoSuspend.kt | 2 +- .../suspendFunctionAsCoroutine/simple.kt | 2 +- .../suspendFunctionAsCoroutine/superCall.kt | 2 +- .../superCallAbstractClass.kt | 4 ++-- .../superCallInterface.kt | 2 +- .../withVariables.kt | 2 +- .../suspendFunctionTypeCall/localVal.kt | 2 +- .../suspendFunctionTypeCall/manyParameters.kt | 2 +- .../suspendFunctionTypeCall/simple.kt | 2 +- .../suspendFunctionTypeCall/suspendModifier.kt | 2 +- .../codegen/box/coroutines/suspendInCycle.kt | 4 ++-- .../suspendInTheMiddleOfObjectConstruction.kt | 6 +++--- ...iddleOfObjectConstructionEvaluationOrder.kt | 2 +- ...TheMiddleOfObjectConstructionWithJumpOut.kt | 6 +++--- .../box/coroutines/suspensionInsideSafeCall.kt | 2 +- .../suspensionInsideSafeCallWithElvis.kt | 2 +- .../inlineWithStateMachine.kt | 2 +- .../inlineWithoutStateMachine.kt | 2 +- .../coroutines/tailCallOptimizations/simple.kt | 2 +- .../coroutines/tailOperations/suspendWithIf.kt | 2 +- .../tailOperations/suspendWithTryCatch.kt | 2 +- .../tailOperations/suspendWithWhen.kt | 2 +- .../tryCatchFinallyWithHandleResult.kt | 4 ++-- .../box/coroutines/tryCatchWithHandleResult.kt | 4 ++-- .../coroutines/tryFinallyInsideInlineLambda.kt | 2 +- .../coroutines/tryFinallyWithHandleResult.kt | 4 ++-- .../unitTypeReturn/coroutineNonLocalReturn.kt | 2 +- .../unitTypeReturn/coroutineReturn.kt | 2 +- .../unitTypeReturn/suspendNonLocalReturn.kt | 2 +- .../coroutines/unitTypeReturn/suspendReturn.kt | 2 +- .../coroutines/unitTypeReturn/unitSafeCall.kt | 2 +- .../box/coroutines/varSpilling/kt19475.kt | 2 +- .../box/coroutines/varSpilling/nullSpilling.kt | 2 +- .../coroutines/varValueConflictsWithTable.kt | 2 +- .../varValueConflictsWithTableSameSort.kt | 2 +- .../boxInline/suspend/capturedVariables.kt | 4 ++-- .../codegen/boxInline/suspend/returnValue.kt | 2 +- .../suspend/stateMachine/innerLambda.kt | 4 ++-- .../stateMachine/innerLambdaInsideLambda.kt | 4 ++-- .../innerLambdaWithoutCrossinline.kt | 4 ++-- .../suspend/stateMachine/innerMadness.kt | 4 ++-- .../stateMachine/innerMadnessCallSite.kt | 4 ++-- .../suspend/stateMachine/innerObject.kt | 4 ++-- .../innerObjectInsideInnerObject.kt | 4 ++-- .../innerObjectWithoutCapturingCrossinline.kt | 4 ++-- .../suspend/stateMachine/normalInline.kt | 4 ++-- .../coroutineContextIntrinsic.kt | 6 +++--- .../codegen/bytecodeListing/coroutineFields.kt | 2 +- .../tailcall/tailCallIntrinsics.kt | 6 +++--- .../coroutines/doNotReassignContinuation.kt | 2 +- .../doNotReassignContinuation_1_2.kt | 2 +- .../intLikeVarSpilling/complicatedMerge.kt | 2 +- .../coroutines/intLikeVarSpilling/i2bResult.kt | 2 +- .../intLikeVarSpilling/loadFromBooleanArray.kt | 2 +- .../intLikeVarSpilling/loadFromByteArray.kt | 2 +- .../intLikeVarSpilling/noVariableInTable.kt | 2 +- .../intLikeVarSpilling/sameIconst1ManyVars.kt | 2 +- .../intLikeVarSpilling/usedInArrayStore.kt | 2 +- .../intLikeVarSpilling/usedInMethodCall.kt | 2 +- .../intLikeVarSpilling/usedInPutfield.kt | 2 +- .../intLikeVarSpilling/usedInVarStore.kt | 2 +- .../coroutines/returnUnitInLambda.kt | 4 ++-- .../coroutines/varValueConflictsWithTable.kt | 2 +- .../varValueConflictsWithTableSameSort_1_2.kt | 2 +- .../varValueConflictsWithTable_1_2.kt | 2 +- compiler/testData/codegen/java8/box/async.kt | 2 +- .../codegen/java8/box/asyncException.kt | 2 +- .../coroutines/suspendCoroutineOrReturn.kt | 6 +++--- .../coroutines/suspendCoroutineOrReturn_1_2.kt | 6 +++--- .../suspendCoroutineUnavailableWithOldAPI.kt | 2 +- .../coroutines/tailCalls/forbidden.kt | 6 +++--- .../tailCalls/nothingTypedSuspendFunction.kt | 2 +- .../coroutines/tailCalls/tryCatch.kt | 6 +++--- .../coroutines/tailCalls/valid.kt | 6 +++--- 189 files changed, 258 insertions(+), 258 deletions(-) diff --git a/compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutines.kt b/compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutines.kt index 838dc2e48f6..bda3cb7e131 100644 --- a/compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutines.kt +++ b/compiler/testData/codegen/box/closures/capturedVarsOptimization/withCoroutines.kt @@ -12,7 +12,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var result = "" - suspend fun suspendWithResult(value: T): T = suspendCoroutineOrReturn { c -> + suspend fun suspendWithResult(value: T): T = suspendCoroutineUninterceptedOrReturn { c -> c.resume(value) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/32defaultParametersInSuspend.kt b/compiler/testData/codegen/box/coroutines/32defaultParametersInSuspend.kt index 8272644c449..6334d67b038 100644 --- a/compiler/testData/codegen/box/coroutines/32defaultParametersInSuspend.kt +++ b/compiler/testData/codegen/box/coroutines/32defaultParametersInSuspend.kt @@ -41,7 +41,7 @@ class Controller { i29: Int = 1, i30: Int = 1, i31: Int = 1 - ): String = suspendCoroutineOrReturn { x -> + ): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(a + "#" + (i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11 + i12 + i13 + i14 + i15 + i16 + i17 + i18 + i19 + i20 + i21 + i22 + i23 + i24 + i25 + i26 + i27 + i28 + i29 + i30 + i31)) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/accessorForSuspend.kt b/compiler/testData/codegen/box/coroutines/accessorForSuspend.kt index 523f4354322..5dc82ebfb03 100644 --- a/compiler/testData/codegen/box/coroutines/accessorForSuspend.kt +++ b/compiler/testData/codegen/box/coroutines/accessorForSuspend.kt @@ -12,7 +12,7 @@ fun builder(c: suspend () -> Unit) { } class A { - suspend private fun a(): String = suspendCoroutineOrReturn { x -> + suspend private fun a(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/asyncIterator.kt b/compiler/testData/codegen/box/coroutines/asyncIterator.kt index 4d83dfe74de..c87482e406e 100644 --- a/compiler/testData/codegen/box/coroutines/asyncIterator.kt +++ b/compiler/testData/codegen/box/coroutines/asyncIterator.kt @@ -40,14 +40,14 @@ class AsyncGeneratorIterator: AsyncIterator, AsyncGenerator, Continuati override val context = EmptyCoroutineContext - suspend fun computeHasNext(): Boolean = suspendCoroutineOrReturn { c -> + suspend fun computeHasNext(): Boolean = suspendCoroutineUninterceptedOrReturn { c -> computesNext = false computeContinuation = c nextStep!!.resume(Unit) COROUTINE_SUSPENDED } - suspend fun computeNext(): T = suspendCoroutineOrReturn { c -> + suspend fun computeNext(): T = suspendCoroutineUninterceptedOrReturn { c -> computesNext = true computeContinuation = c nextStep!!.resume(Unit) @@ -97,7 +97,7 @@ class AsyncGeneratorIterator: AsyncIterator, AsyncGenerator, Continuati } // Generator implementation - override suspend fun yield(value: T): Unit = suspendCoroutineOrReturn { c -> + override suspend fun yield(value: T): Unit = suspendCoroutineUninterceptedOrReturn { c -> computedNext = true nextValue = value nextStep = c diff --git a/compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt b/compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt index 074db75e103..ed6708530f1 100644 --- a/compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt +++ b/compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt @@ -40,14 +40,14 @@ class AsyncGeneratorIterator: AsyncIterator, AsyncGenerator, Continuati override val context = EmptyCoroutineContext - suspend fun computeHasNext(): Boolean = suspendCoroutineOrReturn { c -> + suspend fun computeHasNext(): Boolean = suspendCoroutineUninterceptedOrReturn { c -> computesNext = false computeContinuation = c nextStep!!.resume(Unit) COROUTINE_SUSPENDED } - suspend fun computeNext(): T = suspendCoroutineOrReturn { c -> + suspend fun computeNext(): T = suspendCoroutineUninterceptedOrReturn { c -> computesNext = true computeContinuation = c nextStep!!.resume(Unit) @@ -97,7 +97,7 @@ class AsyncGeneratorIterator: AsyncIterator, AsyncGenerator, Continuati } // Generator implementation - override suspend fun yield(value: T): Unit = suspendCoroutineOrReturn { c -> + override suspend fun yield(value: T): Unit = suspendCoroutineUninterceptedOrReturn { c -> computedNext = true nextValue = value nextStep = c diff --git a/compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt b/compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt index a85f011bfec..b139d4a3db5 100644 --- a/compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt +++ b/compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt @@ -40,14 +40,14 @@ class AsyncGeneratorIterator: AsyncIterator, AsyncGenerator, Continuati override val context = EmptyCoroutineContext - suspend fun computeHasNext(): Boolean = suspendCoroutineOrReturn { c -> + suspend fun computeHasNext(): Boolean = suspendCoroutineUninterceptedOrReturn { c -> computesNext = false computeContinuation = c nextStep!!.resume(Unit) COROUTINE_SUSPENDED } - suspend fun computeNext(): T = suspendCoroutineOrReturn { c -> + suspend fun computeNext(): T = suspendCoroutineUninterceptedOrReturn { c -> computesNext = true computeContinuation = c nextStep!!.resume(Unit) @@ -97,7 +97,7 @@ class AsyncGeneratorIterator: AsyncIterator, AsyncGenerator, Continuati } // Generator implementation - override suspend fun yield(value: T): Unit = suspendCoroutineOrReturn { c -> + override suspend fun yield(value: T): Unit = suspendCoroutineUninterceptedOrReturn { c -> computedNext = true nextValue = value nextStep = c diff --git a/compiler/testData/codegen/box/coroutines/beginWithException.kt b/compiler/testData/codegen/box/coroutines/beginWithException.kt index 98d269a0e38..594dd0cd91d 100644 --- a/compiler/testData/codegen/box/coroutines/beginWithException.kt +++ b/compiler/testData/codegen/box/coroutines/beginWithException.kt @@ -7,7 +7,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendHere(): Any = suspendCoroutineOrReturn { x -> } +suspend fun suspendHere(): Any = suspendCoroutineUninterceptedOrReturn { x -> } fun builder(c: suspend () -> Unit) { var exception: Throwable? = null diff --git a/compiler/testData/codegen/box/coroutines/beginWithExceptionNoHandleException.kt b/compiler/testData/codegen/box/coroutines/beginWithExceptionNoHandleException.kt index e250544f567..193610d01e7 100644 --- a/compiler/testData/codegen/box/coroutines/beginWithExceptionNoHandleException.kt +++ b/compiler/testData/codegen/box/coroutines/beginWithExceptionNoHandleException.kt @@ -6,7 +6,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendHere(): Any = suspendCoroutineOrReturn { x ->} +suspend fun suspendHere(): Any = suspendCoroutineUninterceptedOrReturn { x ->} fun builder(c: suspend () -> Unit) { try { diff --git a/compiler/testData/codegen/box/coroutines/coercionToUnit.kt b/compiler/testData/codegen/box/coroutines/coercionToUnit.kt index 119a985fc2f..e3757646af7 100644 --- a/compiler/testData/codegen/box/coroutines/coercionToUnit.kt +++ b/compiler/testData/codegen/box/coroutines/coercionToUnit.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun await(t: T): T = suspendCoroutineOrReturn { c -> +suspend fun await(t: T): T = suspendCoroutineUninterceptedOrReturn { c -> c.resume(t) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/controlFlow/breakFinally.kt b/compiler/testData/codegen/box/coroutines/controlFlow/breakFinally.kt index 8dd0be62a51..c046cc280bd 100644 --- a/compiler/testData/codegen/box/coroutines/controlFlow/breakFinally.kt +++ b/compiler/testData/codegen/box/coroutines/controlFlow/breakFinally.kt @@ -11,7 +11,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var result = "" - suspend fun suspendWithResult(value: T): T = suspendCoroutineOrReturn { c -> + suspend fun suspendWithResult(value: T): T = suspendCoroutineUninterceptedOrReturn { c -> c.resume(value) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/controlFlow/breakStatement.kt b/compiler/testData/codegen/box/coroutines/controlFlow/breakStatement.kt index ad658545e0e..18f936a0bec 100644 --- a/compiler/testData/codegen/box/coroutines/controlFlow/breakStatement.kt +++ b/compiler/testData/codegen/box/coroutines/controlFlow/breakStatement.kt @@ -11,7 +11,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var result = "" - suspend fun suspendWithResult(value: T): T = suspendCoroutineOrReturn { c -> + suspend fun suspendWithResult(value: T): T = suspendCoroutineUninterceptedOrReturn { c -> c.resume(value) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/controlFlow/doWhileStatement.kt b/compiler/testData/codegen/box/coroutines/controlFlow/doWhileStatement.kt index 5c70bdb445d..af9cb656d1b 100644 --- a/compiler/testData/codegen/box/coroutines/controlFlow/doWhileStatement.kt +++ b/compiler/testData/codegen/box/coroutines/controlFlow/doWhileStatement.kt @@ -11,7 +11,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var result = "" - suspend fun suspendWithResult(value: T): T = suspendCoroutineOrReturn { c -> + suspend fun suspendWithResult(value: T): T = suspendCoroutineUninterceptedOrReturn { c -> c.resume(value) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/controlFlow/forContinue.kt b/compiler/testData/codegen/box/coroutines/controlFlow/forContinue.kt index 985755fb101..7524de0cea2 100644 --- a/compiler/testData/codegen/box/coroutines/controlFlow/forContinue.kt +++ b/compiler/testData/codegen/box/coroutines/controlFlow/forContinue.kt @@ -11,7 +11,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var result = "" - suspend fun suspendWithResult(value: T): T = suspendCoroutineOrReturn { c -> + suspend fun suspendWithResult(value: T): T = suspendCoroutineUninterceptedOrReturn { c -> c.resume(value) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/controlFlow/forStatement.kt b/compiler/testData/codegen/box/coroutines/controlFlow/forStatement.kt index 7051bb2a9c6..a37836a956d 100644 --- a/compiler/testData/codegen/box/coroutines/controlFlow/forStatement.kt +++ b/compiler/testData/codegen/box/coroutines/controlFlow/forStatement.kt @@ -11,7 +11,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var result = "" - suspend fun suspendWithResult(value: T): T = suspendCoroutineOrReturn { c -> + suspend fun suspendWithResult(value: T): T = suspendCoroutineUninterceptedOrReturn { c -> c.resume(value) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/controlFlow/forWithStep.kt b/compiler/testData/codegen/box/coroutines/controlFlow/forWithStep.kt index bd93c067e39..d591bddd6b7 100644 --- a/compiler/testData/codegen/box/coroutines/controlFlow/forWithStep.kt +++ b/compiler/testData/codegen/box/coroutines/controlFlow/forWithStep.kt @@ -11,7 +11,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var result = "" - suspend fun suspendWithResult(value: T): T = suspendCoroutineOrReturn { c -> + suspend fun suspendWithResult(value: T): T = suspendCoroutineUninterceptedOrReturn { c -> c.resume(value) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt b/compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt index f233804ec16..134b6b43d18 100644 --- a/compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt +++ b/compiler/testData/codegen/box/coroutines/controlFlow/ifStatement.kt @@ -11,7 +11,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var result = "" - suspend fun suspendWithResult(value: T): T = suspendCoroutineOrReturn { c -> + suspend fun suspendWithResult(value: T): T = suspendCoroutineUninterceptedOrReturn { c -> c.resume(value) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt b/compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt index 8dff3b09e9b..bec775e4df2 100644 --- a/compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt +++ b/compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt @@ -41,7 +41,7 @@ fun box(): String { return "OK" } -suspend fun suspendAndContinue(): Unit = suspendCoroutineOrReturn { c -> +suspend fun suspendAndContinue(): Unit = suspendCoroutineUninterceptedOrReturn { c -> postponed = { c.resume(Unit) } diff --git a/compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt b/compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt index 3528fa2ac38..5efe6b15a6c 100644 --- a/compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt +++ b/compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt @@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var result = "" - suspend fun suspendAndLog(value: T): T = suspendCoroutineOrReturn { c -> + suspend fun suspendAndLog(value: T): T = suspendCoroutineUninterceptedOrReturn { c -> result += "suspend($value);" c.resume(value) COROUTINE_SUSPENDED diff --git a/compiler/testData/codegen/box/coroutines/controlFlow/switchLikeWhen.kt b/compiler/testData/codegen/box/coroutines/controlFlow/switchLikeWhen.kt index 6de362ee147..ed6a2218723 100644 --- a/compiler/testData/codegen/box/coroutines/controlFlow/switchLikeWhen.kt +++ b/compiler/testData/codegen/box/coroutines/controlFlow/switchLikeWhen.kt @@ -11,7 +11,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var result = "" - suspend fun suspendWithResult(value: T): T = suspendCoroutineOrReturn { c -> + suspend fun suspendWithResult(value: T): T = suspendCoroutineUninterceptedOrReturn { c -> result += "[" c.resume(value) COROUTINE_SUSPENDED diff --git a/compiler/testData/codegen/box/coroutines/controlFlow/throwFromCatch.kt b/compiler/testData/codegen/box/coroutines/controlFlow/throwFromCatch.kt index 0dc9f15896f..4b47db56325 100644 --- a/compiler/testData/codegen/box/coroutines/controlFlow/throwFromCatch.kt +++ b/compiler/testData/codegen/box/coroutines/controlFlow/throwFromCatch.kt @@ -11,14 +11,14 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var result = "" - suspend fun suspendAndLog(value: T): T = suspendCoroutineOrReturn { c -> + suspend fun suspendAndLog(value: T): T = suspendCoroutineUninterceptedOrReturn { c -> result += "suspend($value);" c.resume(value) COROUTINE_SUSPENDED } // Tail calls are not allowed to be Nothing typed. See KT-15051 - suspend fun suspendLogAndThrow(exception: Throwable): Any? = suspendCoroutineOrReturn { c -> + suspend fun suspendLogAndThrow(exception: Throwable): Any? = suspendCoroutineUninterceptedOrReturn { c -> result += "throw(${exception.message});" c.resumeWithException(exception) COROUTINE_SUSPENDED diff --git a/compiler/testData/codegen/box/coroutines/controlFlow/throwInTryWithHandleResult.kt b/compiler/testData/codegen/box/coroutines/controlFlow/throwInTryWithHandleResult.kt index a764477187a..eeb02805dca 100644 --- a/compiler/testData/codegen/box/coroutines/controlFlow/throwInTryWithHandleResult.kt +++ b/compiler/testData/codegen/box/coroutines/controlFlow/throwInTryWithHandleResult.kt @@ -11,7 +11,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var result = "" - suspend fun suspendAndLog(value: T): T = suspendCoroutineOrReturn { c -> + suspend fun suspendAndLog(value: T): T = suspendCoroutineUninterceptedOrReturn { c -> result += "suspend($value);" c.resume(value) COROUTINE_SUSPENDED diff --git a/compiler/testData/codegen/box/coroutines/controlFlow/whileStatement.kt b/compiler/testData/codegen/box/coroutines/controlFlow/whileStatement.kt index 0b497cd5ca6..6fae0c98f7d 100644 --- a/compiler/testData/codegen/box/coroutines/controlFlow/whileStatement.kt +++ b/compiler/testData/codegen/box/coroutines/controlFlow/whileStatement.kt @@ -12,7 +12,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var result = "" - suspend fun suspendWithResult(value: T): T = suspendCoroutineOrReturn { c -> + suspend fun suspendWithResult(value: T): T = suspendCoroutineUninterceptedOrReturn { c -> c.resume(value) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/controllerAccessFromInnerLambda.kt b/compiler/testData/codegen/box/coroutines/controllerAccessFromInnerLambda.kt index 417fc6d0dcd..4910c26df5a 100644 --- a/compiler/testData/codegen/box/coroutines/controllerAccessFromInnerLambda.kt +++ b/compiler/testData/codegen/box/coroutines/controllerAccessFromInnerLambda.kt @@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var result = false - suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/coroutineToString.kt b/compiler/testData/codegen/box/coroutines/coroutineToString.kt index 7a8b188ddea..d50ddb527d9 100644 --- a/compiler/testData/codegen/box/coroutines/coroutineToString.kt +++ b/compiler/testData/codegen/box/coroutines/coroutineToString.kt @@ -13,7 +13,7 @@ class A { suspend fun bar(): T { foo() - return suspendCoroutineOrReturn { x -> + return suspendCoroutineUninterceptedOrReturn { x -> x.resume(x.toString() as T) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/coroutineToString_1_2.kt b/compiler/testData/codegen/box/coroutines/coroutineToString_1_2.kt index 7abbb9ace1a..d114dcb32cf 100644 --- a/compiler/testData/codegen/box/coroutines/coroutineToString_1_2.kt +++ b/compiler/testData/codegen/box/coroutines/coroutineToString_1_2.kt @@ -11,7 +11,7 @@ class A { suspend fun bar(): T { foo() - return suspendCoroutineOrReturn { x -> + return suspendCoroutineUninterceptedOrReturn { x -> x.resume(x.toString() as T) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/defaultParametersInSuspend.kt b/compiler/testData/codegen/box/coroutines/defaultParametersInSuspend.kt index 9a6a29ccb3e..339593532a7 100644 --- a/compiler/testData/codegen/box/coroutines/defaultParametersInSuspend.kt +++ b/compiler/testData/codegen/box/coroutines/defaultParametersInSuspend.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(a: String = "abc", i: Int = 2): String = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(a: String = "abc", i: Int = 2): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(a + "#" + (i + 1)) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/emptyClosure.kt b/compiler/testData/codegen/box/coroutines/emptyClosure.kt index d4caaf428c8..6b52a798628 100644 --- a/compiler/testData/codegen/box/coroutines/emptyClosure.kt +++ b/compiler/testData/codegen/box/coroutines/emptyClosure.kt @@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.* var result = 0 class Controller { - suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> result++ x.resume("OK") COROUTINE_SUSPENDED diff --git a/compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt b/compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt index 6e015b3ac9f..d707a66e99b 100644 --- a/compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt +++ b/compiler/testData/codegen/box/coroutines/falseUnitCoercion.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(v: T): T = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(v: T): T = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt index c63a7776c91..b806f087c2e 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt @@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.* class A { var result = mutableListOf("O", "K", null) - suspend fun foo(): String? = suspendCoroutineOrReturn { x -> + suspend fun foo(): String? = suspendCoroutineUninterceptedOrReturn { x -> x.resume(result.removeAt(0)) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt index d7d89cd225f..f3dee7749e8 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt @@ -6,7 +6,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend inline fun Long.longArgs(a: Long, b: Long, c: Long) = suspendCoroutineOrReturn { +suspend inline fun Long.longArgs(a: Long, b: Long, c: Long) = suspendCoroutineUninterceptedOrReturn { it.resume(this + a + b + c) COROUTINE_SUSPENDED } @@ -22,4 +22,4 @@ fun box(): String { res = ref(1L, 1L, 1L) } return if (res == 4L) "OK" else "FAIL $res" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceivers.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceivers.kt index 6e8946c27f8..e18a899e9ca 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceivers.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceivers.kt @@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.intrinsics.* import kotlin.test.assertEquals class A(val w: String) { - suspend fun String.ext(): String = suspendCoroutineOrReturn { + suspend fun String.ext(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(this + w) COROUTINE_SUSPENDED diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceiversLong.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceiversLong.kt index ee0962d24a6..45dc3572017 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceiversLong.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/safeCallOnTwoReceiversLong.kt @@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.intrinsics.* import kotlin.test.assertEquals class A(val w: String) { - suspend fun Long.ext(): String = suspendCoroutineOrReturn { + suspend fun Long.ext(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(this.toString() + w) COROUTINE_SUSPENDED diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/suspendDestructuringInLambdas.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/suspendDestructuringInLambdas.kt index d65e6dc4e70..8074777c57e 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/suspendDestructuringInLambdas.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/suspendDestructuringInLambdas.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* data class A(val o: String) { - operator suspend fun component2(): String = suspendCoroutineOrReturn { x -> + operator suspend fun component2(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("K") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt index 1a8bcbcca51..f969161b283 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt @@ -8,7 +8,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendThere(v: A): A = suspendCoroutineOrReturn { x -> +suspend fun suspendThere(v: A): A = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } @@ -31,4 +31,4 @@ fun box(): String { var a = A("") builder { a = usePlusAssign() } return a.value -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusAssign.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusAssign.kt index 3a6f897c949..8f1ae570236 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusAssign.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusAssign.kt @@ -8,7 +8,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendThere(v: A): A = suspendCoroutineOrReturn { x -> +suspend fun suspendThere(v: A): A = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } @@ -33,4 +33,4 @@ fun box(): String { var a = A("") builder { a = usePlusAssign() } return a.value -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusCallFromLambda.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusCallFromLambda.kt index fc0d0cb2b6b..fc32035069c 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusCallFromLambda.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlusCallFromLambda.kt @@ -8,7 +8,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendThere(v: A): A = suspendCoroutineOrReturn { x -> +suspend fun suspendThere(v: A): A = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/extention.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/extention.kt index b9916fbe9f4..8a14d09ecaa 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/extention.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/tailrec/extention.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* import kotlin.test.assertEquals -suspend fun ArrayList.yield(v: Int): Unit = suspendCoroutineOrReturn { x -> +suspend fun ArrayList.yield(v: Int): Unit = suspendCoroutineUninterceptedOrReturn { x -> this.add(v) x.resume(Unit) COROUTINE_SUSPENDED diff --git a/compiler/testData/codegen/box/coroutines/generate.kt b/compiler/testData/codegen/box/coroutines/generate.kt index 6c8945af3b5..c9f5ceb8679 100644 --- a/compiler/testData/codegen/box/coroutines/generate.kt +++ b/compiler/testData/codegen/box/coroutines/generate.kt @@ -57,7 +57,7 @@ class GeneratedIterator(block: suspend Generator.() -> Unit) : AbstractIte override fun computeNext() { nextStep.resume(Unit) } - suspend override fun yield(value: T) = suspendCoroutineOrReturn { c -> + suspend override fun yield(value: T) = suspendCoroutineUninterceptedOrReturn { c -> setNext(value) nextStep = c diff --git a/compiler/testData/codegen/box/coroutines/handleException.kt b/compiler/testData/codegen/box/coroutines/handleException.kt index 8981cde06b3..2f44299fefe 100644 --- a/compiler/testData/codegen/box/coroutines/handleException.kt +++ b/compiler/testData/codegen/box/coroutines/handleException.kt @@ -11,7 +11,7 @@ class Controller { var exception: Throwable? = null val postponedActions = ArrayList<() -> Unit>() - suspend fun suspendWithValue(v: String): String = suspendCoroutineOrReturn { x -> + suspend fun suspendWithValue(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> postponedActions.add { x.resume(v) } @@ -19,7 +19,7 @@ class Controller { COROUTINE_SUSPENDED } - suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x -> + suspend fun suspendWithException(e: Exception): String = suspendCoroutineUninterceptedOrReturn { x -> postponedActions.add { x.resumeWithException(e) } diff --git a/compiler/testData/codegen/box/coroutines/handleResultNonUnitExpression.kt b/compiler/testData/codegen/box/coroutines/handleResultNonUnitExpression.kt index f1ed89dd075..936ba29d46d 100644 --- a/compiler/testData/codegen/box/coroutines/handleResultNonUnitExpression.kt +++ b/compiler/testData/codegen/box/coroutines/handleResultNonUnitExpression.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/handleResultSuspended.kt b/compiler/testData/codegen/box/coroutines/handleResultSuspended.kt index 709f692ef18..4f7447a84e9 100644 --- a/compiler/testData/codegen/box/coroutines/handleResultSuspended.kt +++ b/compiler/testData/codegen/box/coroutines/handleResultSuspended.kt @@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var log = "" - suspend fun suspendAndLog(value: T): T = suspendCoroutineOrReturn { x -> + suspend fun suspendAndLog(value: T): T = suspendCoroutineUninterceptedOrReturn { x -> log += "suspend($value);" x.resume(value) COROUTINE_SUSPENDED diff --git a/compiler/testData/codegen/box/coroutines/illegalState.kt b/compiler/testData/codegen/box/coroutines/illegalState.kt index 81b37ccc8f3..875ce5bbb0b 100644 --- a/compiler/testData/codegen/box/coroutines/illegalState.kt +++ b/compiler/testData/codegen/box/coroutines/illegalState.kt @@ -8,7 +8,7 @@ import helpers.* import kotlin.coroutines.* import kotlin.coroutines.intrinsics.* -suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/illegalState_1_2.kt b/compiler/testData/codegen/box/coroutines/illegalState_1_2.kt index bedfbb3e06b..3fdfa8c0992 100644 --- a/compiler/testData/codegen/box/coroutines/illegalState_1_2.kt +++ b/compiler/testData/codegen/box/coroutines/illegalState_1_2.kt @@ -6,7 +6,7 @@ import helpers.* import kotlin.coroutines.experimental.* import kotlin.coroutines.experimental.intrinsics.* -suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/inlineFunInGenericClass.kt b/compiler/testData/codegen/box/coroutines/inlineFunInGenericClass.kt index 9199c7e1256..5dd8f593435 100644 --- a/compiler/testData/codegen/box/coroutines/inlineFunInGenericClass.kt +++ b/compiler/testData/codegen/box/coroutines/inlineFunInGenericClass.kt @@ -7,7 +7,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendThere(v: Any?): String = suspendCoroutineOrReturn { x -> +suspend fun suspendThere(v: Any?): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v?.toString() ?: "") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt b/compiler/testData/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt index 42591933bdc..18f62c9ba6b 100644 --- a/compiler/testData/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt +++ b/compiler/testData/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt @@ -8,7 +8,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x -> +suspend fun suspendThere(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt b/compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt index 3eccd6fb3e9..1cdc38ae603 100644 --- a/compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt +++ b/compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt @@ -17,7 +17,7 @@ class Controller { x.resume(v) } - suspend inline fun suspendInline(v: String): String = suspendCoroutineOrReturn { x -> + suspend inline fun suspendInline(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> withValue(v, x) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt b/compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt index 031abe12c16..9406a457440 100644 --- a/compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt +++ b/compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt @@ -12,7 +12,7 @@ var wasCalled = false class Controller { val postponedActions = mutableListOf<() -> Unit>() - suspend fun suspendWithValue(v: String): String = suspendCoroutineOrReturn { x -> + suspend fun suspendWithValue(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> postponedActions.add { x.resume(v) } @@ -20,7 +20,7 @@ class Controller { COROUTINE_SUSPENDED } - suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x -> + suspend fun suspendWithException(e: Exception): String = suspendCoroutineUninterceptedOrReturn { x -> postponedActions.add { x.resumeWithException(e) } diff --git a/compiler/testData/codegen/box/coroutines/innerSuspensionCalls.kt b/compiler/testData/codegen/box/coroutines/innerSuspensionCalls.kt index 3a79fc80e91..a8fb8e5104a 100644 --- a/compiler/testData/codegen/box/coroutines/innerSuspensionCalls.kt +++ b/compiler/testData/codegen/box/coroutines/innerSuspensionCalls.kt @@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var i = 0 - suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume((i++).toString()) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/instanceOfContinuation.kt b/compiler/testData/codegen/box/coroutines/instanceOfContinuation.kt index 929d1139fef..74e8b4ec03d 100644 --- a/compiler/testData/codegen/box/coroutines/instanceOfContinuation.kt +++ b/compiler/testData/codegen/box/coroutines/instanceOfContinuation.kt @@ -10,13 +10,13 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun runInstanceOf(): Boolean = suspendCoroutineOrReturn { x -> + suspend fun runInstanceOf(): Boolean = suspendCoroutineUninterceptedOrReturn { x -> val y: Any = x x.resume(x is Continuation<*>) COROUTINE_SUSPENDED } - suspend fun runCast(): Boolean = suspendCoroutineOrReturn { x -> + suspend fun runCast(): Boolean = suspendCoroutineUninterceptedOrReturn { x -> val y: Any = x x.resume(Continuation::class.isInstance(y as Continuation<*>)) COROUTINE_SUSPENDED diff --git a/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/complicatedMerge.kt b/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/complicatedMerge.kt index a39edb86a67..5c94a5a99ca 100644 --- a/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/complicatedMerge.kt +++ b/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/complicatedMerge.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/i2bResult.kt b/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/i2bResult.kt index 99327b9e8dd..e9974d4499f 100644 --- a/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/i2bResult.kt +++ b/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/i2bResult.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt b/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt index dda4dfb1a5e..c48fcb3b0c5 100644 --- a/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt +++ b/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromByteArray.kt b/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromByteArray.kt index f1f0d1f4022..ffcac12f1a6 100644 --- a/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromByteArray.kt +++ b/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/loadFromByteArray.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/noVariableInTable.kt b/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/noVariableInTable.kt index 4426fd081c6..a8a5a7d1731 100644 --- a/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/noVariableInTable.kt +++ b/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/noVariableInTable.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt b/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt index 86fb46b2697..dc94854ec25 100644 --- a/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt +++ b/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInArrayStore.kt b/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInArrayStore.kt index 55b061bb2b8..96457812505 100644 --- a/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInArrayStore.kt +++ b/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInArrayStore.kt @@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInMethodCall.kt b/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInMethodCall.kt index 9cfa50e6f67..e5509dc825e 100644 --- a/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInMethodCall.kt +++ b/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInMethodCall.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInPutfield.kt b/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInPutfield.kt index 9e11cbd4075..3c433b8477c 100644 --- a/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInPutfield.kt +++ b/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInPutfield.kt @@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInVarStore.kt b/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInVarStore.kt index 67388b3d52d..ca214c479cb 100644 --- a/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInVarStore.kt +++ b/compiler/testData/codegen/box/coroutines/intLikeVarSpilling/usedInVarStore.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutine.kt b/compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutine.kt index 8a39902baa6..f426016ebe1 100644 --- a/compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutine.kt +++ b/compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutine.kt @@ -8,12 +8,12 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* import kotlin.test.assertEquals -suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") COROUTINE_SUSPENDED } -suspend fun suspendWithException(): String = suspendCoroutineOrReturn { x -> +suspend fun suspendWithException(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resumeWithException(RuntimeException("OK")) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturn.kt b/compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturn.kt index 9acd37595e6..72955f7397c 100644 --- a/compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturn.kt +++ b/compiler/testData/codegen/box/coroutines/intrinsicSemantics/startCoroutineUninterceptedOrReturn.kt @@ -8,12 +8,12 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* import kotlin.test.assertEquals -suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") COROUTINE_SUSPENDED } -suspend fun suspendWithException(): String = suspendCoroutineOrReturn { x -> +suspend fun suspendWithException(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resumeWithException(RuntimeException("OK")) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/iterateOverArray.kt b/compiler/testData/codegen/box/coroutines/iterateOverArray.kt index ff019603b2e..41db33da1b6 100644 --- a/compiler/testData/codegen/box/coroutines/iterateOverArray.kt +++ b/compiler/testData/codegen/box/coroutines/iterateOverArray.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/kt12958.kt b/compiler/testData/codegen/box/coroutines/kt12958.kt index 6eaca234a1d..21be6f6462a 100644 --- a/compiler/testData/codegen/box/coroutines/kt12958.kt +++ b/compiler/testData/codegen/box/coroutines/kt12958.kt @@ -8,7 +8,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendHere(v: V): V = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(v: V): V = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/kt15016.kt b/compiler/testData/codegen/box/coroutines/kt15016.kt index fa164693243..2e5e18df3bc 100644 --- a/compiler/testData/codegen/box/coroutines/kt15016.kt +++ b/compiler/testData/codegen/box/coroutines/kt15016.kt @@ -6,7 +6,7 @@ import helpers.* import COROUTINES_PACKAGE.intrinsics.COROUTINE_SUSPENDED -import COROUTINES_PACKAGE.intrinsics.suspendCoroutineOrReturn +import COROUTINES_PACKAGE.intrinsics.suspendCoroutineUninterceptedOrReturn import COROUTINES_PACKAGE.* class Bar(val x: Any) @@ -26,7 +26,7 @@ class Foo(val value: Any) { } } -suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/kt15930.kt b/compiler/testData/codegen/box/coroutines/kt15930.kt index 0365411e3a4..1616462a738 100644 --- a/compiler/testData/codegen/box/coroutines/kt15930.kt +++ b/compiler/testData/codegen/box/coroutines/kt15930.kt @@ -10,8 +10,8 @@ import COROUTINES_PACKAGE.* class A { var isMinusAssignCalled = false - operator suspend fun minusAssign(y: String): Unit = suspendCoroutineOrReturn { x -> - if (y != "56") return@suspendCoroutineOrReturn Unit + operator suspend fun minusAssign(y: String): Unit = suspendCoroutineUninterceptedOrReturn { x -> + if (y != "56") return@suspendCoroutineUninterceptedOrReturn Unit isMinusAssignCalled = true x.resume(Unit) COROUTINE_SUSPENDED diff --git a/compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt b/compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt index d56af54d281..2a2317de3af 100644 --- a/compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt +++ b/compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt @@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var result = "" var ok = false - suspend fun suspendHere(v: String): Unit = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(v: String): Unit = suspendCoroutineUninterceptedOrReturn { x -> result += v x.resume(Unit) COROUTINE_SUSPENDED diff --git a/compiler/testData/codegen/box/coroutines/lastStatementInc.kt b/compiler/testData/codegen/box/coroutines/lastStatementInc.kt index 19aea4a4497..e76862be806 100644 --- a/compiler/testData/codegen/box/coroutines/lastStatementInc.kt +++ b/compiler/testData/codegen/box/coroutines/lastStatementInc.kt @@ -7,7 +7,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/lastStementAssignment.kt b/compiler/testData/codegen/box/coroutines/lastStementAssignment.kt index 89e84a2a4cb..cd3a9907ff3 100644 --- a/compiler/testData/codegen/box/coroutines/lastStementAssignment.kt +++ b/compiler/testData/codegen/box/coroutines/lastStementAssignment.kt @@ -7,7 +7,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/lastUnitExpression.kt b/compiler/testData/codegen/box/coroutines/lastUnitExpression.kt index d0eedef8147..9ce2ecdf57b 100644 --- a/compiler/testData/codegen/box/coroutines/lastUnitExpression.kt +++ b/compiler/testData/codegen/box/coroutines/lastUnitExpression.kt @@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var ok = false var v = "fail" - suspend fun suspendHere(v: String): Unit = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(v: String): Unit = suspendCoroutineUninterceptedOrReturn { x -> this.v = v x.resume(Unit) COROUTINE_SUSPENDED diff --git a/compiler/testData/codegen/box/coroutines/localCallableRef.kt b/compiler/testData/codegen/box/coroutines/localCallableRef.kt index 1c779c5813b..86d7f45086c 100644 --- a/compiler/testData/codegen/box/coroutines/localCallableRef.kt +++ b/compiler/testData/codegen/box/coroutines/localCallableRef.kt @@ -7,7 +7,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendWithValue(result: () -> String): String = suspendCoroutineOrReturn { x -> +suspend fun suspendWithValue(result: () -> String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(result()) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/localDelegate.kt b/compiler/testData/codegen/box/coroutines/localDelegate.kt index e66dec57941..5810f0d9295 100644 --- a/compiler/testData/codegen/box/coroutines/localDelegate.kt +++ b/compiler/testData/codegen/box/coroutines/localDelegate.kt @@ -6,13 +6,13 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.COROUTINE_SUSPENDED -import COROUTINES_PACKAGE.intrinsics.suspendCoroutineOrReturn +import COROUTINES_PACKAGE.intrinsics.suspendCoroutineUninterceptedOrReturn class OkDelegate { operator fun getValue(receiver: Any?, property: Any?): String = "OK" } -suspend fun suspendWithValue(value: T): T = suspendCoroutineOrReturn { c -> +suspend fun suspendWithValue(value: T): T = suspendCoroutineUninterceptedOrReturn { c -> c.resume(value) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/localFunctions/named/capturedParameters.kt b/compiler/testData/codegen/box/coroutines/localFunctions/named/capturedParameters.kt index 75293b1277c..c7305aceba4 100644 --- a/compiler/testData/codegen/box/coroutines/localFunctions/named/capturedParameters.kt +++ b/compiler/testData/codegen/box/coroutines/localFunctions/named/capturedParameters.kt @@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* suspend fun callLocal(a: String, b: String): String { - suspend fun local() = suspendCoroutineOrReturn { + suspend fun local() = suspendCoroutineUninterceptedOrReturn { it.resume(a + b) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/localFunctions/named/capturedVariables.kt b/compiler/testData/codegen/box/coroutines/localFunctions/named/capturedVariables.kt index fb24cd2302e..f3d37ee3a89 100644 --- a/compiler/testData/codegen/box/coroutines/localFunctions/named/capturedVariables.kt +++ b/compiler/testData/codegen/box/coroutines/localFunctions/named/capturedVariables.kt @@ -11,7 +11,7 @@ import COROUTINES_PACKAGE.intrinsics.* suspend fun callLocal(): String { val a = "O" val b = "K" - suspend fun local() = suspendCoroutineOrReturn { + suspend fun local() = suspendCoroutineUninterceptedOrReturn { it.resume(a + b) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/localFunctions/named/extension.kt b/compiler/testData/codegen/box/coroutines/localFunctions/named/extension.kt index dfa05ede912..5b10356f86e 100644 --- a/compiler/testData/codegen/box/coroutines/localFunctions/named/extension.kt +++ b/compiler/testData/codegen/box/coroutines/localFunctions/named/extension.kt @@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* suspend fun callLocal(): String { - suspend fun String.local() = suspendCoroutineOrReturn { + suspend fun String.local() = suspendCoroutineUninterceptedOrReturn { it.resume(this) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/localFunctions/named/infix.kt b/compiler/testData/codegen/box/coroutines/localFunctions/named/infix.kt index d9549a6e5b1..e2c7dd0b59c 100644 --- a/compiler/testData/codegen/box/coroutines/localFunctions/named/infix.kt +++ b/compiler/testData/codegen/box/coroutines/localFunctions/named/infix.kt @@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* suspend fun callLocal(): String { - suspend infix fun String.local(a: String) = suspendCoroutineOrReturn { + suspend infix fun String.local(a: String) = suspendCoroutineUninterceptedOrReturn { it.resume(this + a) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/localFunctions/named/insideLambda.kt b/compiler/testData/codegen/box/coroutines/localFunctions/named/insideLambda.kt index 4adea3ec98c..970b2e1652c 100644 --- a/compiler/testData/codegen/box/coroutines/localFunctions/named/insideLambda.kt +++ b/compiler/testData/codegen/box/coroutines/localFunctions/named/insideLambda.kt @@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.* suspend fun callLocal(): String { val l: suspend () -> String = { - suspend fun local() = suspendCoroutineOrReturn { + suspend fun local() = suspendCoroutineUninterceptedOrReturn { it.resume("OK") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/localFunctions/named/simpleSuspensionPoint.kt b/compiler/testData/codegen/box/coroutines/localFunctions/named/simpleSuspensionPoint.kt index 5b4ac168ca0..f4992c78102 100644 --- a/compiler/testData/codegen/box/coroutines/localFunctions/named/simpleSuspensionPoint.kt +++ b/compiler/testData/codegen/box/coroutines/localFunctions/named/simpleSuspensionPoint.kt @@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* suspend fun callLocal(): String { - suspend fun local() = suspendCoroutineOrReturn { + suspend fun local() = suspendCoroutineUninterceptedOrReturn { it.resume("OK") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/localFunctions/named/withArguments.kt b/compiler/testData/codegen/box/coroutines/localFunctions/named/withArguments.kt index c07d5e953cc..248eee38639 100644 --- a/compiler/testData/codegen/box/coroutines/localFunctions/named/withArguments.kt +++ b/compiler/testData/codegen/box/coroutines/localFunctions/named/withArguments.kt @@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* suspend fun callLocal(a: String, b: String): String { - suspend fun local(a: String, b: String) = suspendCoroutineOrReturn { + suspend fun local(a: String, b: String) = suspendCoroutineUninterceptedOrReturn { it.resume(a + b) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/longRangeInSuspendCall.kt b/compiler/testData/codegen/box/coroutines/longRangeInSuspendCall.kt index 62ee23baa6f..299473f6fdf 100644 --- a/compiler/testData/codegen/box/coroutines/longRangeInSuspendCall.kt +++ b/compiler/testData/codegen/box/coroutines/longRangeInSuspendCall.kt @@ -7,12 +7,12 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun getLong(): Long = suspendCoroutineOrReturn { x -> +suspend fun getLong(): Long = suspendCoroutineUninterceptedOrReturn { x -> x.resume(1234567890123L) COROUTINE_SUSPENDED } -suspend fun suspendHere(r: LongRange): Long = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(r: LongRange): Long = suspendCoroutineUninterceptedOrReturn { x -> x.resume(r.start + r.endInclusive) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/longRangeInSuspendFun.kt b/compiler/testData/codegen/box/coroutines/longRangeInSuspendFun.kt index 3862a0d3a2c..bedd85c468b 100644 --- a/compiler/testData/codegen/box/coroutines/longRangeInSuspendFun.kt +++ b/compiler/testData/codegen/box/coroutines/longRangeInSuspendFun.kt @@ -7,7 +7,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendHere(r: LongRange): Long = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(r: LongRange): Long = suspendCoroutineUninterceptedOrReturn { x -> x.resume(r.start + r.endInclusive) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/mergeNullAndString.kt b/compiler/testData/codegen/box/coroutines/mergeNullAndString.kt index 252d6db1970..68b896259be 100644 --- a/compiler/testData/codegen/box/coroutines/mergeNullAndString.kt +++ b/compiler/testData/codegen/box/coroutines/mergeNullAndString.kt @@ -23,7 +23,7 @@ suspend fun foo(y: A?): String { return res } -suspend fun baz(y: String): Unit = suspendCoroutineOrReturn { x -> +suspend fun baz(y: String): Unit = suspendCoroutineUninterceptedOrReturn { x -> res += y[res.length] x.resume(Unit) COROUTINE_SUSPENDED diff --git a/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt b/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt index 0fea41c191a..328924dad16 100644 --- a/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt +++ b/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt @@ -16,7 +16,7 @@ var continuation: () -> Unit = { } var log = "" var finished = false -suspend fun foo(v: T): T = suspendCoroutineOrReturn { x -> +suspend fun foo(v: T): T = suspendCoroutineUninterceptedOrReturn { x -> continuation = { x.resume(v) } diff --git a/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt b/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt index 61a7593b9d6..d33a37113ce 100644 --- a/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt +++ b/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt @@ -16,7 +16,7 @@ var continuation: () -> Unit = { } var log = "" var finished = false -suspend fun foo(v: T): T = suspendCoroutineOrReturn { x -> +suspend fun foo(v: T): T = suspendCoroutineUninterceptedOrReturn { x -> continuation = { x.resume(v) } diff --git a/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt b/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt index e3cc085f5c9..ac9325cca55 100644 --- a/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt +++ b/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt @@ -28,7 +28,7 @@ class C { } } -suspend fun foo(v: T): T = suspendCoroutineOrReturn { x -> +suspend fun foo(v: T): T = suspendCoroutineUninterceptedOrReturn { x -> continuation = { x.resume(v) } diff --git a/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt b/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt index 8fe4f8f37ae..389ea371c4f 100644 --- a/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt +++ b/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt @@ -16,7 +16,7 @@ var continuation: () -> Unit = { } var log = "" var finished = false -suspend fun foo(v: T): T = suspendCoroutineOrReturn { x -> +suspend fun foo(v: T): T = suspendCoroutineUninterceptedOrReturn { x -> continuation = { x.resume(v) } diff --git a/compiler/testData/codegen/box/coroutines/multiModule/simple.kt b/compiler/testData/codegen/box/coroutines/multiModule/simple.kt index 4ecfa68aaa4..e6df97e04af 100644 --- a/compiler/testData/codegen/box/coroutines/multiModule/simple.kt +++ b/compiler/testData/codegen/box/coroutines/multiModule/simple.kt @@ -12,7 +12,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/multipleInvokeCalls.kt b/compiler/testData/codegen/box/coroutines/multipleInvokeCalls.kt index 935723b3934..8d0dfcfc9de 100644 --- a/compiler/testData/codegen/box/coroutines/multipleInvokeCalls.kt +++ b/compiler/testData/codegen/box/coroutines/multipleInvokeCalls.kt @@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var lastSuspension: Continuation? = null var result = "fail" - suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> lastSuspension = x COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda1.kt b/compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda1.kt index 397bfd750ac..e12cb2296a3 100644 --- a/compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda1.kt +++ b/compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda1.kt @@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var lastSuspension: Continuation? = null var result = "fail" - suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> lastSuspension = x COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda2.kt b/compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda2.kt index c9c9ed73341..f72a1085c4f 100644 --- a/compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda2.kt +++ b/compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda2.kt @@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var lastSuspension: Continuation? = null var result = "fail" - suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> lastSuspension = x COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda3.kt b/compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda3.kt index 2f360b5301c..f10d25d9d4b 100644 --- a/compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda3.kt +++ b/compiler/testData/codegen/box/coroutines/multipleInvokeCallsInsideInlineLambda3.kt @@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var lastSuspension: Continuation? = null var result = "fail" - suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> lastSuspension = x COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/nestedTryCatch.kt b/compiler/testData/codegen/box/coroutines/nestedTryCatch.kt index d4b7bfc08c8..0e7a850d1d0 100644 --- a/compiler/testData/codegen/box/coroutines/nestedTryCatch.kt +++ b/compiler/testData/codegen/box/coroutines/nestedTryCatch.kt @@ -12,7 +12,7 @@ var wasCalled = false class Controller { val postponedActions = ArrayList<() -> Unit>() - suspend fun suspendWithValue(v: String): String = suspendCoroutineOrReturn { x -> + suspend fun suspendWithValue(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> postponedActions.add { x.resume(v) } @@ -20,7 +20,7 @@ class Controller { COROUTINE_SUSPENDED } - suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x -> + suspend fun suspendWithException(e: Exception): String = suspendCoroutineUninterceptedOrReturn { x -> postponedActions.add { x.resumeWithException(e) } diff --git a/compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambda.kt b/compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambda.kt index 2c7e4a9aeec..a47e6017c0c 100644 --- a/compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambda.kt +++ b/compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambda.kt @@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var cResult = 0 - suspend fun suspendHere(v: Int): Int = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(v: Int): Int = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v * 2) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt b/compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt index 0b1fc72d3f0..2f9e6aa7624 100644 --- a/compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt +++ b/compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt @@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var cResult = 0 - suspend fun suspendHere(v: Int): Int = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(v: Int): Int = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v * 2) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/recursiveSuspend.kt b/compiler/testData/codegen/box/coroutines/recursiveSuspend.kt index 967857de11c..48165f95721 100644 --- a/compiler/testData/codegen/box/coroutines/recursiveSuspend.kt +++ b/compiler/testData/codegen/box/coroutines/recursiveSuspend.kt @@ -26,7 +26,7 @@ fun box(): String { suspend fun factorial(a: Int): Int = if (a > 0) suspendHere(factorial(a - 1) * a) else suspendHere(1) -suspend fun suspendHere(value: Int): Int = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(value: Int): Int = suspendCoroutineUninterceptedOrReturn { x -> postponed = { log += "$value;" x.resume(value) diff --git a/compiler/testData/codegen/box/coroutines/returnByLabel.kt b/compiler/testData/codegen/box/coroutines/returnByLabel.kt index 08283e697e4..89ff13fb423 100644 --- a/compiler/testData/codegen/box/coroutines/returnByLabel.kt +++ b/compiler/testData/codegen/box/coroutines/returnByLabel.kt @@ -7,7 +7,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/simple.kt b/compiler/testData/codegen/box/coroutines/simple.kt index 0c272f10ceb..63565f9cab6 100644 --- a/compiler/testData/codegen/box/coroutines/simple.kt +++ b/compiler/testData/codegen/box/coroutines/simple.kt @@ -7,7 +7,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/simpleException.kt b/compiler/testData/codegen/box/coroutines/simpleException.kt index 5a217b8132e..d8b3e51f717 100644 --- a/compiler/testData/codegen/box/coroutines/simpleException.kt +++ b/compiler/testData/codegen/box/coroutines/simpleException.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resumeWithException(RuntimeException("OK")) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/simpleWithHandleResult.kt b/compiler/testData/codegen/box/coroutines/simpleWithHandleResult.kt index e19351b8481..76550090bc7 100644 --- a/compiler/testData/codegen/box/coroutines/simpleWithHandleResult.kt +++ b/compiler/testData/codegen/box/coroutines/simpleWithHandleResult.kt @@ -7,7 +7,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/stackUnwinding/suspendInCycle.kt b/compiler/testData/codegen/box/coroutines/stackUnwinding/suspendInCycle.kt index 088e31622d1..ff74024b493 100644 --- a/compiler/testData/codegen/box/coroutines/stackUnwinding/suspendInCycle.kt +++ b/compiler/testData/codegen/box/coroutines/stackUnwinding/suspendInCycle.kt @@ -8,10 +8,10 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): Int = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): Int = suspendCoroutineUninterceptedOrReturn { x -> 1 } - suspend fun suspendThere(): String = suspendCoroutineOrReturn { x -> + suspend fun suspendThere(): String = suspendCoroutineUninterceptedOrReturn { x -> "?" } } diff --git a/compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt b/compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt index b19a80dad48..366cce1527b 100644 --- a/compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt +++ b/compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* var globalResult = "" -suspend fun suspendWithValue(v: String): String = suspendCoroutineOrReturn { x -> +suspend fun suspendWithValue(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt b/compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt index 806f70caced..8efe1788d8b 100644 --- a/compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt +++ b/compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt @@ -5,7 +5,7 @@ // COMMON_COROUTINES_TEST import helpers.* import COROUTINES_PACKAGE.* -import COROUTINES_PACKAGE.intrinsics.suspendCoroutineOrReturn +import COROUTINES_PACKAGE.intrinsics.suspendCoroutineUninterceptedOrReturn import COROUTINES_PACKAGE.intrinsics.COROUTINE_SUSPENDED fun box(): String { @@ -34,13 +34,13 @@ fun async(f: suspend () -> Unit) { suspend fun wait(): Unit { wait2() log += "wait;" - return suspendCoroutineOrReturn { c -> + return suspendCoroutineUninterceptedOrReturn { c -> postponed = { c.resume(Unit) } COROUTINE_SUSPENDED } } -suspend fun wait2(): Unit = suspendCoroutineOrReturn { c -> +suspend fun wait2(): Unit = suspendCoroutineUninterceptedOrReturn { c -> log += "wait2;" postponed = { c.resume(Unit) } COROUTINE_SUSPENDED diff --git a/compiler/testData/codegen/box/coroutines/suspendDefaultImpl.kt b/compiler/testData/codegen/box/coroutines/suspendDefaultImpl.kt index 4a2b804b6f0..13e864113d0 100644 --- a/compiler/testData/codegen/box/coroutines/suspendDefaultImpl.kt +++ b/compiler/testData/codegen/box/coroutines/suspendDefaultImpl.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* interface TestInterface { - suspend fun toInt(): Int = suspendCoroutineOrReturn { x -> + suspend fun toInt(): Int = suspendCoroutineUninterceptedOrReturn { x -> x.resume(56) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendDelegation.kt b/compiler/testData/codegen/box/coroutines/suspendDelegation.kt index 4ba62c83468..2a341540c94 100644 --- a/compiler/testData/codegen/box/coroutines/suspendDelegation.kt +++ b/compiler/testData/codegen/box/coroutines/suspendDelegation.kt @@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { suspend fun suspendHere(): String = suspendThere() - suspend fun suspendThere(): String = suspendCoroutineOrReturn { x -> + suspend fun suspendThere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt b/compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt index 2757fc5c4fe..2146ddf67e5 100644 --- a/compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt +++ b/compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(v: Int): Int = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(v: Int): Int = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v * 2) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendFunImportedFromObject.kt b/compiler/testData/codegen/box/coroutines/suspendFunImportedFromObject.kt index 06a9d40ea3b..8f4c9c47e92 100644 --- a/compiler/testData/codegen/box/coroutines/suspendFunImportedFromObject.kt +++ b/compiler/testData/codegen/box/coroutines/suspendFunImportedFromObject.kt @@ -12,7 +12,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* object Host { - suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt index 6ef0afa2dc9..13df197a964 100644 --- a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt +++ b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/handleException.kt @@ -11,7 +11,7 @@ class Controller { var exception: Throwable? = null val postponedActions = ArrayList<() -> Unit>() - suspend fun suspendWithValue(v: String): String = suspendCoroutineOrReturn { x -> + suspend fun suspendWithValue(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> postponedActions.add { x.resume(v) } @@ -19,7 +19,7 @@ class Controller { COROUTINE_SUSPENDED } - suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x -> + suspend fun suspendWithException(e: Exception): String = suspendCoroutineUninterceptedOrReturn { x -> postponedActions.add { x.resumeWithException(e) } @@ -51,7 +51,7 @@ fun commonThrow(t: Throwable) { throw t } -suspend fun justContinue(): Unit = suspendCoroutineOrReturn { x -> +suspend fun justContinue(): Unit = suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED diff --git a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inline.kt b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inline.kt index e137c54afe7..1f64a2d7089 100644 --- a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inline.kt +++ b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inline.kt @@ -7,7 +7,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x -> +suspend fun suspendThere(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inlineTwoReceivers.kt b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inlineTwoReceivers.kt index 21faa808435..461f53455bd 100644 --- a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inlineTwoReceivers.kt +++ b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/inlineTwoReceivers.kt @@ -6,10 +6,10 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.COROUTINE_SUSPENDED -import COROUTINES_PACKAGE.intrinsics.suspendCoroutineOrReturn +import COROUTINES_PACKAGE.intrinsics.suspendCoroutineUninterceptedOrReturn class MyTest { - suspend fun act(value: String): String = suspendCoroutineOrReturn { + suspend fun act(value: String): String = suspendCoroutineUninterceptedOrReturn { it.resume(value) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/member.kt b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/member.kt index df2bdb9458a..8e830301087 100644 --- a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/member.kt +++ b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/member.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class A(val v: String) { - suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x -> + suspend fun suspendThere(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/noinlineTwoReceivers.kt b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/noinlineTwoReceivers.kt index 5c2e73d441b..39018934762 100644 --- a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/noinlineTwoReceivers.kt +++ b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/noinlineTwoReceivers.kt @@ -6,10 +6,10 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.COROUTINE_SUSPENDED -import COROUTINES_PACKAGE.intrinsics.suspendCoroutineOrReturn +import COROUTINES_PACKAGE.intrinsics.suspendCoroutineUninterceptedOrReturn class MyTest { - suspend fun act(value: String): String = suspendCoroutineOrReturn { + suspend fun act(value: String): String = suspendCoroutineUninterceptedOrReturn { it.resume(value) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava.kt b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava.kt index d22b8619ac4..12500d0f0c3 100644 --- a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava.kt +++ b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava.kt @@ -10,7 +10,7 @@ import kotlin.coroutines.* import kotlin.coroutines.intrinsics.* open class A(val v: String) { - suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x -> + suspend fun suspendThere(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava_1_2.kt b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava_1_2.kt index a001788865f..b7194e517e8 100644 --- a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava_1_2.kt +++ b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava_1_2.kt @@ -10,7 +10,7 @@ import kotlin.coroutines.experimental.intrinsics.* open class A(val v: String) { - suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x -> + suspend fun suspendThere(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/operators.kt b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/operators.kt index 8715cca752e..576350516e5 100644 --- a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/operators.kt +++ b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/operators.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* import kotlin.reflect.KProperty -suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x -> +suspend fun suspendThere(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } @@ -20,14 +20,14 @@ class A(val x: String) { var isIncCalled = false operator suspend fun component1() = suspendThere(x + "K") operator suspend fun getValue(thisRef: Any?, property: KProperty<*>) = suspendThere(x + "K") - operator suspend fun setValue(thisRef: Any?, property: KProperty<*>, value: String): Unit = suspendCoroutineOrReturn { x -> - if (value != "56") return@suspendCoroutineOrReturn Unit + operator suspend fun setValue(thisRef: Any?, property: KProperty<*>, value: String): Unit = suspendCoroutineUninterceptedOrReturn { x -> + if (value != "56") return@suspendCoroutineUninterceptedOrReturn Unit isSetValueCalled = true x.resume(Unit) COROUTINE_SUSPENDED } - operator suspend fun provideDelegate(host: Any?, p: Any): A = suspendCoroutineOrReturn { x -> + operator suspend fun provideDelegate(host: Any?, p: Any): A = suspendCoroutineUninterceptedOrReturn { x -> isProvideDelegateCalled = true x.resume(this) COROUTINE_SUSPENDED @@ -36,25 +36,25 @@ class A(val x: String) { operator suspend fun plus(y: String) = suspendThere(x + y) operator suspend fun unaryPlus() = suspendThere(x + "K") - operator suspend fun inc(): A = suspendCoroutineOrReturn { x -> + operator suspend fun inc(): A = suspendCoroutineUninterceptedOrReturn { x -> isIncCalled = true x.resume(this) COROUTINE_SUSPENDED } - operator suspend fun minusAssign(y: String): Unit = suspendCoroutineOrReturn { x -> - if (y != "56") return@suspendCoroutineOrReturn Unit + operator suspend fun minusAssign(y: String): Unit = suspendCoroutineUninterceptedOrReturn { x -> + if (y != "56") return@suspendCoroutineUninterceptedOrReturn Unit isMinusAssignCalled = true x.resume(Unit) COROUTINE_SUSPENDED } // See KT-16221 -// operator suspend fun contains(y: String): Boolean = suspendCoroutineOrReturn { x -> +// operator suspend fun contains(y: String): Boolean = suspendCoroutineUninterceptedOrReturn { x -> // x.resume(y == "56") // COROUTINE_SUSPENDED // } - operator suspend fun compareTo(y: String): Int = suspendCoroutineOrReturn { x -> + operator suspend fun compareTo(y: String): Int = suspendCoroutineUninterceptedOrReturn { x -> x.resume("56".compareTo(y)) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateFunctions.kt b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateFunctions.kt index 1ae7b2a637e..30fc9708372 100644 --- a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateFunctions.kt +++ b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateFunctions.kt @@ -25,7 +25,7 @@ class X { } } -suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x -> +suspend fun suspendThere(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateInFile.kt b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateInFile.kt index b7692c2cd0b..70efecf84d3 100644 --- a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateInFile.kt +++ b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/privateInFile.kt @@ -11,7 +11,7 @@ import COROUTINES_PACKAGE.intrinsics.* var x = true private suspend fun foo(): String { if (x) { - return suspendCoroutineOrReturn { + return suspendCoroutineUninterceptedOrReturn { it.resume("OK") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/returnNoSuspend.kt b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/returnNoSuspend.kt index 412c87d7fd1..db2360e4fea 100644 --- a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/returnNoSuspend.kt +++ b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/returnNoSuspend.kt @@ -7,7 +7,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x -> +suspend fun suspendThere(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/simple.kt b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/simple.kt index 9afd0be672f..a824ca12ae1 100644 --- a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/simple.kt +++ b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/simple.kt @@ -7,7 +7,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x -> +suspend fun suspendThere(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt index d55172602c7..27de325ae85 100644 --- a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt +++ b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* open class A(val v: String) { - suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x -> + suspend fun suspendThere(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt index 082f3c51fbf..50648ecb78a 100644 --- a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt +++ b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt @@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.* abstract class A(val v: String) { suspend abstract fun foo(v: String): String - suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x -> + suspend fun suspendThere(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } @@ -19,7 +19,7 @@ abstract class A(val v: String) { } class B(v: String) : A(v) { - override suspend fun foo(v: String): String = suspendCoroutineOrReturn { x -> + override suspend fun foo(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt index 794da0b6d79..85a2f1a34a9 100644 --- a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt +++ b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt @@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.* interface A { val v: String - suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x -> + suspend fun suspendThere(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/withVariables.kt b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/withVariables.kt index ec69f9ddf73..a39e8a36f55 100644 --- a/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/withVariables.kt +++ b/compiler/testData/codegen/box/coroutines/suspendFunctionAsCoroutine/withVariables.kt @@ -7,7 +7,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x -> +suspend fun suspendThere(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/localVal.kt b/compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/localVal.kt index 055216fdf14..b2a3831cea6 100644 --- a/compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/localVal.kt +++ b/compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/localVal.kt @@ -7,7 +7,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendHere(v: String): String = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/manyParameters.kt b/compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/manyParameters.kt index 670ecf0a76d..3090fc25b57 100644 --- a/compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/manyParameters.kt +++ b/compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/manyParameters.kt @@ -7,7 +7,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendHere(v: String): String = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/simple.kt b/compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/simple.kt index b13b7e57078..78438709738 100644 --- a/compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/simple.kt +++ b/compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/simple.kt @@ -7,7 +7,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendHere(v: String): String = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/suspendModifier.kt b/compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/suspendModifier.kt index 0ee0a405f6b..a01fb6636a3 100644 --- a/compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/suspendModifier.kt +++ b/compiler/testData/codegen/box/coroutines/suspendFunctionTypeCall/suspendModifier.kt @@ -7,7 +7,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendHere(v: String): String = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendInCycle.kt b/compiler/testData/codegen/box/coroutines/suspendInCycle.kt index d5eedbac683..d88b7d2cdbd 100644 --- a/compiler/testData/codegen/box/coroutines/suspendInCycle.kt +++ b/compiler/testData/codegen/box/coroutines/suspendInCycle.kt @@ -9,11 +9,11 @@ import COROUTINES_PACKAGE.intrinsics.* class Controller { var i = 0 - suspend fun suspendHere(): Int = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): Int = suspendCoroutineUninterceptedOrReturn { x -> x.resume(i++) COROUTINE_SUSPENDED } - suspend fun suspendThere(): String = suspendCoroutineOrReturn { x -> + suspend fun suspendThere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("?") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstruction.kt b/compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstruction.kt index 880fc5c1e27..c0767167492 100644 --- a/compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstruction.kt +++ b/compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstruction.kt @@ -8,17 +8,17 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("K") COROUTINE_SUSPENDED } - suspend fun suspendWithArgument(v: String): String = suspendCoroutineOrReturn { x -> + suspend fun suspendWithArgument(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } - suspend fun suspendWithDouble(v: Double): Double = suspendCoroutineOrReturn { x -> + suspend fun suspendWithDouble(v: Double): Double = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt b/compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt index a36f9e939b2..8984962eb19 100644 --- a/compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt +++ b/compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("K") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt b/compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt index 5e497bd4c75..0d618fcc946 100644 --- a/compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt +++ b/compiler/testData/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt @@ -8,17 +8,17 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("K") COROUTINE_SUSPENDED } - suspend fun suspendWithArgument(v: String): String = suspendCoroutineOrReturn { x -> + suspend fun suspendWithArgument(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } - suspend fun suspendWithDouble(v: Double): Double = suspendCoroutineOrReturn { x -> + suspend fun suspendWithDouble(v: Double): Double = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspensionInsideSafeCall.kt b/compiler/testData/codegen/box/coroutines/suspensionInsideSafeCall.kt index 5e62c6330a1..125b4cf0b4f 100644 --- a/compiler/testData/codegen/box/coroutines/suspensionInsideSafeCall.kt +++ b/compiler/testData/codegen/box/coroutines/suspensionInsideSafeCall.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class TestClass { - suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("K") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/suspensionInsideSafeCallWithElvis.kt b/compiler/testData/codegen/box/coroutines/suspensionInsideSafeCallWithElvis.kt index b462e2bf26e..fc0ad325758 100644 --- a/compiler/testData/codegen/box/coroutines/suspensionInsideSafeCallWithElvis.kt +++ b/compiler/testData/codegen/box/coroutines/suspensionInsideSafeCallWithElvis.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class TestClass { - suspend fun toInt(): Int = suspendCoroutineOrReturn { x -> + suspend fun toInt(): Int = suspendCoroutineUninterceptedOrReturn { x -> x.resume(14) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt b/compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt index cc62e0ce057..680856feb1f 100644 --- a/compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt +++ b/compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithStateMachine.kt @@ -10,7 +10,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -inline suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x -> +inline suspend fun suspendThere(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt b/compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt index a19d2e75eaf..15941bbb3fe 100644 --- a/compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt +++ b/compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt @@ -10,7 +10,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -inline suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x -> +inline suspend fun suspendThere(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt b/compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt index 4678771f6c5..475a3d7d020 100644 --- a/compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt +++ b/compiler/testData/codegen/box/coroutines/tailCallOptimizations/simple.kt @@ -9,7 +9,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x -> +suspend fun suspendThere(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/tailOperations/suspendWithIf.kt b/compiler/testData/codegen/box/coroutines/tailOperations/suspendWithIf.kt index 92d27e2ef16..5829e9940d8 100644 --- a/compiler/testData/codegen/box/coroutines/tailOperations/suspendWithIf.kt +++ b/compiler/testData/codegen/box/coroutines/tailOperations/suspendWithIf.kt @@ -11,7 +11,7 @@ suspend fun foo(x: Any): Int { return if (x == "56") suspendHere() else 13 } -suspend fun suspendHere(): Int = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(): Int = suspendCoroutineUninterceptedOrReturn { x -> x.resume(56) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/tailOperations/suspendWithTryCatch.kt b/compiler/testData/codegen/box/coroutines/tailOperations/suspendWithTryCatch.kt index 42728211193..8cf2360fa78 100644 --- a/compiler/testData/codegen/box/coroutines/tailOperations/suspendWithTryCatch.kt +++ b/compiler/testData/codegen/box/coroutines/tailOperations/suspendWithTryCatch.kt @@ -15,7 +15,7 @@ suspend fun foo(x: Any): Int { } } -suspend fun suspendHere(): Int = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(): Int = suspendCoroutineUninterceptedOrReturn { x -> x.resume(56) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/tailOperations/suspendWithWhen.kt b/compiler/testData/codegen/box/coroutines/tailOperations/suspendWithWhen.kt index 07c5745c3d1..e1bc6d236f3 100644 --- a/compiler/testData/codegen/box/coroutines/tailOperations/suspendWithWhen.kt +++ b/compiler/testData/codegen/box/coroutines/tailOperations/suspendWithWhen.kt @@ -14,7 +14,7 @@ suspend fun foo(x: Any): Int { } } -suspend fun suspendHere(): Int = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(): Int = suspendCoroutineUninterceptedOrReturn { x -> x.resume(56) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/tryCatchFinallyWithHandleResult.kt b/compiler/testData/codegen/box/coroutines/tryCatchFinallyWithHandleResult.kt index f372755c6c9..06147bbb36f 100644 --- a/compiler/testData/codegen/box/coroutines/tryCatchFinallyWithHandleResult.kt +++ b/compiler/testData/codegen/box/coroutines/tryCatchFinallyWithHandleResult.kt @@ -12,7 +12,7 @@ var wasCalled = false class Controller { val postponedActions = ArrayList<() -> Unit>() - suspend fun suspendWithValue(v: String): String = suspendCoroutineOrReturn { x -> + suspend fun suspendWithValue(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> postponedActions.add { x.resume(v) } @@ -20,7 +20,7 @@ class Controller { COROUTINE_SUSPENDED } - suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x -> + suspend fun suspendWithException(e: Exception): String = suspendCoroutineUninterceptedOrReturn { x -> postponedActions.add { x.resumeWithException(e) } diff --git a/compiler/testData/codegen/box/coroutines/tryCatchWithHandleResult.kt b/compiler/testData/codegen/box/coroutines/tryCatchWithHandleResult.kt index a26ec8254b3..d9f2c3d75db 100644 --- a/compiler/testData/codegen/box/coroutines/tryCatchWithHandleResult.kt +++ b/compiler/testData/codegen/box/coroutines/tryCatchWithHandleResult.kt @@ -12,7 +12,7 @@ var wasCalled = false class Controller { val postponedActions = ArrayList<() -> Unit>() - suspend fun suspendWithValue(v: String): String = suspendCoroutineOrReturn { x -> + suspend fun suspendWithValue(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> postponedActions.add { x.resume(v) } @@ -20,7 +20,7 @@ class Controller { COROUTINE_SUSPENDED } - suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x -> + suspend fun suspendWithException(e: Exception): String = suspendCoroutineUninterceptedOrReturn { x -> postponedActions.add { x.resumeWithException(e) } diff --git a/compiler/testData/codegen/box/coroutines/tryFinallyInsideInlineLambda.kt b/compiler/testData/codegen/box/coroutines/tryFinallyInsideInlineLambda.kt index e022572f608..4d71143a95b 100644 --- a/compiler/testData/codegen/box/coroutines/tryFinallyInsideInlineLambda.kt +++ b/compiler/testData/codegen/box/coroutines/tryFinallyInsideInlineLambda.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(v: String): String = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED diff --git a/compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt b/compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt index 988baa53801..7d5560b73cf 100644 --- a/compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt +++ b/compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt @@ -12,7 +12,7 @@ var wasCalled = false class Controller { val postponedActions = mutableListOf<() -> Unit>() - suspend fun suspendWithValue(v: String): String = suspendCoroutineOrReturn { x -> + suspend fun suspendWithValue(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> postponedActions.add { x.resume(v) } @@ -20,7 +20,7 @@ class Controller { COROUTINE_SUSPENDED } - suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x -> + suspend fun suspendWithException(e: Exception): String = suspendCoroutineUninterceptedOrReturn { x -> postponedActions.add { x.resumeWithException(e) } diff --git a/compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineNonLocalReturn.kt b/compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineNonLocalReturn.kt index 7208040924d..ad377fca5b6 100644 --- a/compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineNonLocalReturn.kt +++ b/compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineNonLocalReturn.kt @@ -7,7 +7,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineReturn.kt b/compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineReturn.kt index f123f54e1c8..18432687322 100644 --- a/compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineReturn.kt +++ b/compiler/testData/codegen/box/coroutines/unitTypeReturn/coroutineReturn.kt @@ -7,7 +7,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt b/compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt index 9c5b0c97dc1..69bca8bffe4 100644 --- a/compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt +++ b/compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt @@ -17,7 +17,7 @@ suspend fun suspendHere(x: Int): Unit { } result = "OK" - return suspendCoroutineOrReturn { x -> + return suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendReturn.kt b/compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendReturn.kt index d0f29f1a7b6..83c1db2b473 100644 --- a/compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendReturn.kt +++ b/compiler/testData/codegen/box/coroutines/unitTypeReturn/suspendReturn.kt @@ -12,7 +12,7 @@ var result = "0" suspend fun suspendHere(x: Int): Unit { if (x == 0) return result = "OK" - return suspendCoroutineOrReturn { x -> + return suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt b/compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt index 34363abb29c..d8232e48296 100644 --- a/compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt +++ b/compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt @@ -13,7 +13,7 @@ var complete = false suspend fun suspendHere(x: String): Unit { log += "suspendHere($x);" - return suspendCoroutineOrReturn { c -> + return suspendCoroutineUninterceptedOrReturn { c -> postponed = { c.resume(Unit) } log += "suspended;" COROUTINE_SUSPENDED diff --git a/compiler/testData/codegen/box/coroutines/varSpilling/kt19475.kt b/compiler/testData/codegen/box/coroutines/varSpilling/kt19475.kt index 3aeaa818f37..845999a6984 100644 --- a/compiler/testData/codegen/box/coroutines/varSpilling/kt19475.kt +++ b/compiler/testData/codegen/box/coroutines/varSpilling/kt19475.kt @@ -7,7 +7,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/varSpilling/nullSpilling.kt b/compiler/testData/codegen/box/coroutines/varSpilling/nullSpilling.kt index 448a8ea296a..9e1faa1b67e 100644 --- a/compiler/testData/codegen/box/coroutines/varSpilling/nullSpilling.kt +++ b/compiler/testData/codegen/box/coroutines/varSpilling/nullSpilling.kt @@ -7,7 +7,7 @@ import helpers.* import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun foo(value: String): String = suspendCoroutineOrReturn { x -> +suspend fun foo(value: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(value) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/varValueConflictsWithTable.kt b/compiler/testData/codegen/box/coroutines/varValueConflictsWithTable.kt index d6ee4f9bbc2..e949a863529 100644 --- a/compiler/testData/codegen/box/coroutines/varValueConflictsWithTable.kt +++ b/compiler/testData/codegen/box/coroutines/varValueConflictsWithTable.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/box/coroutines/varValueConflictsWithTableSameSort.kt b/compiler/testData/codegen/box/coroutines/varValueConflictsWithTableSameSort.kt index e5544060f8b..bef3facfa79 100644 --- a/compiler/testData/codegen/box/coroutines/varValueConflictsWithTableSameSort.kt +++ b/compiler/testData/codegen/box/coroutines/varValueConflictsWithTableSameSort.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/boxInline/suspend/capturedVariables.kt b/compiler/testData/codegen/boxInline/suspend/capturedVariables.kt index 70cd1cee3c0..e653ec6d307 100644 --- a/compiler/testData/codegen/boxInline/suspend/capturedVariables.kt +++ b/compiler/testData/codegen/boxInline/suspend/capturedVariables.kt @@ -26,7 +26,7 @@ fun builder(c: suspend () -> Unit) { c.startCoroutine(EmptyContinuation) } -suspend fun calculate() = suspendCoroutineOrReturn { +suspend fun calculate() = suspendCoroutineUninterceptedOrReturn { it.resume("OK") COROUTINE_SUSPENDED } @@ -54,4 +54,4 @@ fun box() : String { } if (res != "OK 462") return res return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxInline/suspend/returnValue.kt b/compiler/testData/codegen/boxInline/suspend/returnValue.kt index 33912ea1a47..dab4fe03b0d 100644 --- a/compiler/testData/codegen/boxInline/suspend/returnValue.kt +++ b/compiler/testData/codegen/boxInline/suspend/returnValue.kt @@ -7,7 +7,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* import helpers.* -inline suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x -> +inline suspend fun suspendThere(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(v) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambda.kt b/compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambda.kt index c70c9cc8570..ea7428efda5 100644 --- a/compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambda.kt +++ b/compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambda.kt @@ -22,7 +22,7 @@ fun builder(c: suspend () -> Unit) { var i = 0; -suspend fun suspendHere() = suspendCoroutineOrReturn { +suspend fun suspendHere() = suspendCoroutineUninterceptedOrReturn { i++ COROUTINE_SUSPENDED } @@ -39,4 +39,4 @@ fun box(): String { } if (i != 1) return "FAIL" return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaInsideLambda.kt b/compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaInsideLambda.kt index 97893971ee9..be2deae7fda 100644 --- a/compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaInsideLambda.kt +++ b/compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaInsideLambda.kt @@ -27,7 +27,7 @@ fun builder(c: suspend () -> Unit) { var i = 0; -suspend fun suspendHere() = suspendCoroutineOrReturn { +suspend fun suspendHere() = suspendCoroutineUninterceptedOrReturn { i++ COROUTINE_SUSPENDED } @@ -44,4 +44,4 @@ fun box(): String { } if (i != 1) return "FAIL $i" return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaWithoutCrossinline.kt b/compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaWithoutCrossinline.kt index f0644d6ae53..ec0b5a35583 100644 --- a/compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaWithoutCrossinline.kt +++ b/compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaWithoutCrossinline.kt @@ -9,7 +9,7 @@ import helpers.* var i = 0; -suspend fun suspendHere() = suspendCoroutineOrReturn { +suspend fun suspendHere() = suspendCoroutineUninterceptedOrReturn { i++ COROUTINE_SUSPENDED } @@ -44,4 +44,4 @@ fun box(): String { } if (i != 1) return "FAIL 2" return res -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadness.kt b/compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadness.kt index 322027bc1e4..d96d20c7c97 100644 --- a/compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadness.kt +++ b/compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadness.kt @@ -49,7 +49,7 @@ fun builder(c: suspend () -> Unit) { var i = 0; -suspend fun suspendHere() = suspendCoroutineOrReturn { +suspend fun suspendHere() = suspendCoroutineUninterceptedOrReturn { i++ COROUTINE_SUSPENDED } @@ -66,4 +66,4 @@ fun box(): String { } if (i != 1) return "FAIL $i" return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadnessCallSite.kt b/compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadnessCallSite.kt index 402d1b2b75f..876046a92ec 100644 --- a/compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadnessCallSite.kt +++ b/compiler/testData/codegen/boxInline/suspend/stateMachine/innerMadnessCallSite.kt @@ -28,7 +28,7 @@ fun builder(c: suspend () -> Unit) { var i = 0; -suspend fun suspendHere() = suspendCoroutineOrReturn { +suspend fun suspendHere() = suspendCoroutineUninterceptedOrReturn { i++ COROUTINE_SUSPENDED } @@ -66,4 +66,4 @@ fun box(): String { } if (i != 1) return "FAIL $i" return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxInline/suspend/stateMachine/innerObject.kt b/compiler/testData/codegen/boxInline/suspend/stateMachine/innerObject.kt index c0dd2374146..d056e354e42 100644 --- a/compiler/testData/codegen/boxInline/suspend/stateMachine/innerObject.kt +++ b/compiler/testData/codegen/boxInline/suspend/stateMachine/innerObject.kt @@ -30,7 +30,7 @@ fun builder(c: suspend () -> Unit) { var i = 0; -suspend fun suspendHere() = suspendCoroutineOrReturn { +suspend fun suspendHere() = suspendCoroutineUninterceptedOrReturn { i++ COROUTINE_SUSPENDED } @@ -47,4 +47,4 @@ fun box(): String { } if (i != 1) return "FAIL $i" return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt b/compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt index eacc3a0f13c..7cbf1b3ff97 100644 --- a/compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt +++ b/compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectInsideInnerObject.kt @@ -35,7 +35,7 @@ fun builder(c: suspend () -> Unit) { var i = 0; -suspend fun suspendHere() = suspendCoroutineOrReturn { +suspend fun suspendHere() = suspendCoroutineUninterceptedOrReturn { i++ COROUTINE_SUSPENDED } @@ -52,4 +52,4 @@ fun box(): String { } if (i != 1) return "FAIL $i" return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectWithoutCapturingCrossinline.kt b/compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectWithoutCapturingCrossinline.kt index 17889646054..d1575f2e28e 100644 --- a/compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectWithoutCapturingCrossinline.kt +++ b/compiler/testData/codegen/boxInline/suspend/stateMachine/innerObjectWithoutCapturingCrossinline.kt @@ -9,7 +9,7 @@ import helpers.* var i = 0; -suspend fun suspendHere() = suspendCoroutineOrReturn { +suspend fun suspendHere() = suspendCoroutineUninterceptedOrReturn { i++ COROUTINE_SUSPENDED } @@ -50,4 +50,4 @@ fun box(): String { } if (i != 1) return "FAIL 2" return res -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxInline/suspend/stateMachine/normalInline.kt b/compiler/testData/codegen/boxInline/suspend/stateMachine/normalInline.kt index 562bf1e3406..a6e84785f73 100644 --- a/compiler/testData/codegen/boxInline/suspend/stateMachine/normalInline.kt +++ b/compiler/testData/codegen/boxInline/suspend/stateMachine/normalInline.kt @@ -22,7 +22,7 @@ fun builder(c: suspend () -> Unit) { var i = 0; -suspend fun suspendHere() = suspendCoroutineOrReturn { +suspend fun suspendHere() = suspendCoroutineUninterceptedOrReturn { i++ COROUTINE_SUSPENDED } @@ -39,4 +39,4 @@ fun box(): String { } if (i != 1) return "FAIL" return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/bytecodeListing/coroutineContextIntrinsic.kt b/compiler/testData/codegen/bytecodeListing/coroutineContextIntrinsic.kt index 29cbf70ef3c..3c406d64a77 100644 --- a/compiler/testData/codegen/bytecodeListing/coroutineContextIntrinsic.kt +++ b/compiler/testData/codegen/bytecodeListing/coroutineContextIntrinsic.kt @@ -3,7 +3,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendHere(ctx: CoroutineContext) = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(ctx: CoroutineContext) = suspendCoroutineUninterceptedOrReturn { x -> if (x.context == ctx) x.resume("OK") else x.resume("FAIL") } @@ -12,8 +12,8 @@ suspend fun mustBeTailCall(): String { } suspend fun retrieveCoroutineContext(): CoroutineContext = - suspendCoroutineOrReturn { cont -> cont.context } + suspendCoroutineUninterceptedOrReturn { cont -> cont.context } suspend fun notTailCall(): String { return suspendHere(retrieveCoroutineContext()) -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/bytecodeListing/coroutineFields.kt b/compiler/testData/codegen/bytecodeListing/coroutineFields.kt index 200dd6a59a9..157186a1bf6 100644 --- a/compiler/testData/codegen/bytecodeListing/coroutineFields.kt +++ b/compiler/testData/codegen/bytecodeListing/coroutineFields.kt @@ -3,7 +3,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere() = suspendCoroutineOrReturn { x -> + suspend fun suspendHere() = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") } diff --git a/compiler/testData/codegen/bytecodeListing/tailcall/tailCallIntrinsics.kt b/compiler/testData/codegen/bytecodeListing/tailcall/tailCallIntrinsics.kt index f414a5326c5..896084090e8 100644 --- a/compiler/testData/codegen/bytecodeListing/tailcall/tailCallIntrinsics.kt +++ b/compiler/testData/codegen/bytecodeListing/tailcall/tailCallIntrinsics.kt @@ -9,11 +9,11 @@ private suspend fun withoutInline() { if (p > 52158) Unit else COROUTINE_SUSPENDED } - return suspendCoroutineOrReturn(c) + return suspendCoroutineUninterceptedOrReturn(c) } private suspend fun withInline() { - return suspendCoroutineOrReturn { c -> + return suspendCoroutineUninterceptedOrReturn { c -> if (p > 52158) Unit else COROUTINE_SUSPENDED } -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/bytecodeText/coroutines/doNotReassignContinuation.kt b/compiler/testData/codegen/bytecodeText/coroutines/doNotReassignContinuation.kt index a06925b716e..a36647eeb77 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/doNotReassignContinuation.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/doNotReassignContinuation.kt @@ -3,7 +3,7 @@ // TREAT_AS_ONE_FILE import kotlin.coroutines.* import kotlin.coroutines.intrinsics.* -suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resumeWith(SuccessOrFailure.success("OK")) } diff --git a/compiler/testData/codegen/bytecodeText/coroutines/doNotReassignContinuation_1_2.kt b/compiler/testData/codegen/bytecodeText/coroutines/doNotReassignContinuation_1_2.kt index 7fbb856a110..6349710758e 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/doNotReassignContinuation_1_2.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/doNotReassignContinuation_1_2.kt @@ -4,7 +4,7 @@ import helpers.* // TREAT_AS_ONE_FILE import kotlin.coroutines.experimental.* import kotlin.coroutines.experimental.intrinsics.* -suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") } diff --git a/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/complicatedMerge.kt b/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/complicatedMerge.kt index 8a64cae1d2a..e4fb5f9bef7 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/complicatedMerge.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/complicatedMerge.kt @@ -7,7 +7,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/i2bResult.kt b/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/i2bResult.kt index f2d336b1ec8..8adcbaf733b 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/i2bResult.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/i2bResult.kt @@ -7,7 +7,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt b/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt index 22c07a07061..df594c61fb6 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt @@ -7,7 +7,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/loadFromByteArray.kt b/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/loadFromByteArray.kt index 43977b93afe..2e3d6130fc6 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/loadFromByteArray.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/loadFromByteArray.kt @@ -7,7 +7,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/noVariableInTable.kt b/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/noVariableInTable.kt index bfd6710fda0..60295fa026f 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/noVariableInTable.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/noVariableInTable.kt @@ -7,7 +7,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt b/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt index a9946e6a63b..89af4fafa40 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt @@ -7,7 +7,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInArrayStore.kt b/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInArrayStore.kt index 6b32ccf5093..19d266671fe 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInArrayStore.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInArrayStore.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInMethodCall.kt b/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInMethodCall.kt index e96740e272c..44ed3199652 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInMethodCall.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInMethodCall.kt @@ -7,7 +7,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInPutfield.kt b/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInPutfield.kt index ef494c8c775..c5d34d6f6ed 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInPutfield.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInPutfield.kt @@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInVarStore.kt b/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInVarStore.kt index 369f44ae849..393337b6edc 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInVarStore.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInVarStore.kt @@ -7,7 +7,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* class Controller { - suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> + suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> x.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/codegen/bytecodeText/coroutines/returnUnitInLambda.kt b/compiler/testData/codegen/bytecodeText/coroutines/returnUnitInLambda.kt index 3beb2dae37c..92f5b42f4bf 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/returnUnitInLambda.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/returnUnitInLambda.kt @@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.intrinsics.* var res = "FAIL" -suspend fun suspendHere() = suspendCoroutineOrReturn { +suspend fun suspendHere() = suspendCoroutineUninterceptedOrReturn { res = "OK" it.resume(Unit) COROUTINE_SUSPENDED @@ -30,4 +30,4 @@ fun box() : String { // we surround it with return unit markers. // While denerating state machine, we remove them. // 0 ICONST_2 -// 0 ICONST_3 \ No newline at end of file +// 0 ICONST_3 diff --git a/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTable.kt b/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTable.kt index c83cc168069..fda71d77db7 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTable.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTable.kt @@ -5,7 +5,7 @@ import helpers.* // TREAT_AS_ONE_FILE import kotlin.coroutines.* import kotlin.coroutines.intrinsics.* -suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") } diff --git a/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTableSameSort_1_2.kt b/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTableSameSort_1_2.kt index 1913beece54..2259c536d2e 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTableSameSort_1_2.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTableSameSort_1_2.kt @@ -4,7 +4,7 @@ import helpers.* // TREAT_AS_ONE_FILE import kotlin.coroutines.experimental.* import kotlin.coroutines.experimental.intrinsics.* -suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") } diff --git a/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTable_1_2.kt b/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTable_1_2.kt index a65d922206e..6627c017a01 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTable_1_2.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTable_1_2.kt @@ -4,7 +4,7 @@ import helpers.* // TREAT_AS_ONE_FILE import kotlin.coroutines.experimental.* import kotlin.coroutines.experimental.intrinsics.* -suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> +suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume("OK") } diff --git a/compiler/testData/codegen/java8/box/async.kt b/compiler/testData/codegen/java8/box/async.kt index 33213598957..8c306a58ade 100644 --- a/compiler/testData/codegen/java8/box/async.kt +++ b/compiler/testData/codegen/java8/box/async.kt @@ -63,7 +63,7 @@ fun async(c: suspend () -> T): CompletableFuture { return future } -suspend fun await(f: CompletableFuture) = suspendCoroutineOrReturn { machine -> +suspend fun await(f: CompletableFuture) = suspendCoroutineUninterceptedOrReturn { machine -> f.whenComplete { value, throwable -> if (throwable == null) machine.resume(value) diff --git a/compiler/testData/codegen/java8/box/asyncException.kt b/compiler/testData/codegen/java8/box/asyncException.kt index 003ba55aea8..b9073f9721f 100644 --- a/compiler/testData/codegen/java8/box/asyncException.kt +++ b/compiler/testData/codegen/java8/box/asyncException.kt @@ -60,7 +60,7 @@ fun async(c: suspend () -> T): CompletableFuture { return future } -suspend fun await(f: CompletableFuture) = suspendCoroutineOrReturn { machine -> +suspend fun await(f: CompletableFuture) = suspendCoroutineUninterceptedOrReturn { machine -> f.whenComplete { value, throwable -> if (throwable == null) machine.resume(value) diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineOrReturn.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineOrReturn.kt index 4a3351b64b5..239320893e3 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineOrReturn.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineOrReturn.kt @@ -7,7 +7,7 @@ import kotlin.coroutines.* import kotlin.coroutines.intrinsics.* class Controller { - suspend fun noParams(): Unit = suspendCoroutineOrReturn { + suspend fun noParams(): Unit = suspendCoroutineUninterceptedOrReturn { if (hashCode() % 2 == 0) { it.resume(Unit) COROUTINE_SUSPENDED @@ -16,12 +16,12 @@ class Controller { Unit } } - suspend fun yieldString(value: String) = suspendCoroutineOrReturn { + suspend fun yieldString(value: String) = suspendCoroutineUninterceptedOrReturn { it.resume(1) it checkType { _>() } it.resume("") - // We can return anything here, 'suspendCoroutineOrReturn' is not very type-safe + // We can return anything here, 'suspendCoroutineUninterceptedOrReturn' is not very type-safe // Also we can call resume and then return the value too, but it's still just our problem "Not-int" } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineOrReturn_1_2.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineOrReturn_1_2.kt index e90d2917783..a2bb9152dc5 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineOrReturn_1_2.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineOrReturn_1_2.kt @@ -5,7 +5,7 @@ import kotlin.coroutines.experimental.* import kotlin.coroutines.experimental.intrinsics.* class Controller { - suspend fun noParams(): Unit = suspendCoroutineOrReturn { + suspend fun noParams(): Unit = suspendCoroutineUninterceptedOrReturn { if (hashCode() % 2 == 0) { it.resume(Unit) COROUTINE_SUSPENDED @@ -14,12 +14,12 @@ class Controller { Unit } } - suspend fun yieldString(value: String) = suspendCoroutineOrReturn { + suspend fun yieldString(value: String) = suspendCoroutineUninterceptedOrReturn { it.resume(1) it checkType { _>() } it.resume("") - // We can return anything here, 'suspendCoroutineOrReturn' is not very type-safe + // We can return anything here, 'suspendCoroutineUninterceptedOrReturn' is not very type-safe // Also we can call resume and then return the value too, but it's still just our problem "Not-int" } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineUnavailableWithOldAPI.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineUnavailableWithOldAPI.kt index fdae1824309..e0e6d3612d7 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineUnavailableWithOldAPI.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineUnavailableWithOldAPI.kt @@ -8,7 +8,7 @@ import kotlin.coroutines.experimental.intrinsics.* it.resume(Unit) } -suspend fun bar(): Unit = suspendCoroutineOrReturn { +suspend fun bar(): Unit = suspendCoroutineUninterceptedOrReturn { it.resume(Unit) COROUTINE_SUSPENDED } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/forbidden.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/forbidden.kt index 6a6a3ec3b4f..ac172e444c8 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/forbidden.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/forbidden.kt @@ -6,15 +6,15 @@ import COROUTINES_PACKAGE.intrinsics.* fun nonSuspend() {} suspend fun foo() { - suspendCoroutineOrReturn { x: Continuation -> } + suspendCoroutineUninterceptedOrReturn { x: Continuation -> } nonSuspend() } suspend fun unitSuspend() { - suspendCoroutineOrReturn { x: Continuation -> } + suspendCoroutineUninterceptedOrReturn { x: Continuation -> } } suspend fun baz(): Int = run { - suspendCoroutineOrReturn { x: Continuation -> } + suspendCoroutineUninterceptedOrReturn { x: Continuation -> } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction.kt index 8acf90ead7d..3ae6f2f1c5b 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction.kt @@ -3,7 +3,7 @@ import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendLogAndThrow(exception: Throwable): Nothing = suspendCoroutineOrReturn { c -> +suspend fun suspendLogAndThrow(exception: Throwable): Nothing = suspendCoroutineUninterceptedOrReturn { c -> c.resumeWithException(exception) COROUTINE_SUSPENDED } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/tryCatch.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/tryCatch.kt index e98e41f2b57..38b9068663c 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/tryCatch.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/tryCatch.kt @@ -9,7 +9,7 @@ suspend fun baz(): Int = 1 suspend fun tryCatch(): Int { return try { - suspendCoroutineOrReturn { x: Continuation -> } + suspendCoroutineUninterceptedOrReturn { x: Continuation -> } } catch (e: Exception) { baz() // another suspend function } @@ -17,7 +17,7 @@ suspend fun tryCatch(): Int { suspend fun tryFinally(): Int { return try { - suspendCoroutineOrReturn { x: Continuation -> } + suspendCoroutineUninterceptedOrReturn { x: Continuation -> } } finally { nonSuspend() } @@ -33,7 +33,7 @@ suspend fun returnInFinally(): Int { suspend fun tryCatchFinally(): Int { return try { - suspendCoroutineOrReturn { x: Continuation -> } + suspendCoroutineUninterceptedOrReturn { x: Continuation -> } } catch (e: Exception) { baz() // another suspend function } finally { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/valid.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/valid.kt index 85516b35e57..0a4f1649297 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/valid.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/valid.kt @@ -16,17 +16,17 @@ suspend fun bar1() { return if (1.hashCode() > 0) { foo() } - else suspendCoroutineOrReturn { x: Continuation -> } + else suspendCoroutineUninterceptedOrReturn { x: Continuation -> } } suspend fun bar2() = if (1.hashCode() > 0) { foo() } - else suspendCoroutineOrReturn { x: Continuation -> } + else suspendCoroutineUninterceptedOrReturn { x: Continuation -> } suspend fun bar3() = when { true -> { foo() } - else -> suspendCoroutineOrReturn { x: Continuation -> } + else -> suspendCoroutineUninterceptedOrReturn { x: Continuation -> } }