Purge remaining traces of @AllowSuspendExtensions.
This commit is contained in:
committed by
Stanislav Erokhin
parent
5a353412e4
commit
9fd1ac72a9
@@ -2,10 +2,6 @@ package-fragment kotlin.coroutines
|
||||
|
||||
@kotlin.SinceKotlin(version = "1.1") public inline suspend fun </*0*/ T> suspendWithCurrentContinuation(/*0*/ body: (kotlin.coroutines.Continuation<T>) -> kotlin.Any?): T
|
||||
|
||||
@kotlin.SinceKotlin(version = "1.1") @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS}) @kotlin.annotation.Retention(value = AnnotationRetention.BINARY) public final annotation class AllowSuspendExtensions : kotlin.Annotation {
|
||||
/*primary*/ public constructor AllowSuspendExtensions()
|
||||
}
|
||||
|
||||
@kotlin.SinceKotlin(version = "1.1") public interface Continuation</*0*/ in P> {
|
||||
public abstract fun resume(/*0*/ data: P): kotlin.Unit
|
||||
public abstract fun resumeWithException(/*0*/ exception: kotlin.Throwable): kotlin.Unit
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// MODULE: controller
|
||||
// FILE: controller.kt
|
||||
package lib
|
||||
|
||||
import kotlin.coroutines.*
|
||||
|
||||
@AllowSuspendExtensions
|
||||
class Controller {
|
||||
suspend fun String.suspendHere(): String = suspendWithCurrentContinuation { x ->
|
||||
x.resume(this)
|
||||
SUSPENDED
|
||||
}
|
||||
|
||||
inline suspend fun String.inlineSuspendHere(): String = suspendHere()
|
||||
}
|
||||
|
||||
suspend fun Controller.suspendExtension(v: String): String = v.suspendHere()
|
||||
|
||||
inline suspend fun Controller.inlineSuspendExtension(v: String) = v.inlineSuspendHere()
|
||||
|
||||
// MODULE: main(controller)
|
||||
// FILE: main.kt
|
||||
import lib.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
suspend fun Controller.localSuspendExtension(v: String) = v.suspendHere()
|
||||
|
||||
inline suspend fun Controller.localInlineSuspendExtension(v: String) = v.inlineSuspendHere()
|
||||
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var result = ""
|
||||
|
||||
builder {
|
||||
if ("56".suspendHere() != "56") throw RuntimeException("fail 1")
|
||||
if ("28".inlineSuspendHere() != "28") throw RuntimeException("fail 2")
|
||||
|
||||
if (suspendExtension("123") != "123") throw RuntimeException("fail 3")
|
||||
if (inlineSuspendExtension("234") != "234") throw RuntimeException("fail 4")
|
||||
|
||||
if (localSuspendExtension("9123") != "9123") throw RuntimeException("fail 5")
|
||||
if (localInlineSuspendExtension("9234") != "9234") throw RuntimeException("fail 6")
|
||||
|
||||
result = "OK"
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
import kotlin.coroutines.*
|
||||
|
||||
@AllowSuspendExtensions
|
||||
class Controller {
|
||||
suspend fun String.suspendHere(): String = suspendWithCurrentContinuation { x ->
|
||||
x.resume(this)
|
||||
SUSPENDED
|
||||
}
|
||||
|
||||
inline suspend fun String.inlineSuspendHere(): String = suspendHere()
|
||||
}
|
||||
|
||||
suspend fun Controller.suspendExtension(v: String): String = v.suspendHere()
|
||||
|
||||
inline suspend fun Controller.inlineSuspendExtension(v: String): String = v.inlineSuspendHere()
|
||||
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var result = ""
|
||||
|
||||
builder {
|
||||
if ("56".suspendHere() != "56") throw RuntimeException("fail 1")
|
||||
if ("28".inlineSuspendHere() != "28") throw RuntimeException("fail 2")
|
||||
|
||||
if (suspendExtension("123") != "123") throw RuntimeException("fail 3")
|
||||
result = inlineSuspendExtension("OK")
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
public final class CoroutineUtilKt {
|
||||
public final static @org.jetbrains.annotations.NotNull method handleExceptionContinuation(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1): kotlin.coroutines.Continuation
|
||||
public final static @org.jetbrains.annotations.NotNull method handleResultContinuation(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1): kotlin.coroutines.Continuation
|
||||
}
|
||||
|
||||
|
||||
public final class EmptyContinuation {
|
||||
public final static field INSTANCE: EmptyContinuation
|
||||
private method <init>(): void
|
||||
public method resume(@org.jetbrains.annotations.Nullable p0: java.lang.Object): void
|
||||
public method resumeWithException(@org.jetbrains.annotations.NotNull p0: java.lang.Throwable): void
|
||||
}
|
||||
|
||||
|
||||
public final class MainKt {
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
public final static method builder(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function2): void
|
||||
public final static @org.jetbrains.annotations.Nullable method localInlineSuspendExtension(@org.jetbrains.annotations.NotNull p0: lib.Controller, @org.jetbrains.annotations.NotNull p1: java.lang.String, @org.jetbrains.annotations.NotNull p2: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method localSuspendExtension(@org.jetbrains.annotations.NotNull p0: lib.Controller, @org.jetbrains.annotations.NotNull p1: java.lang.String, @org.jetbrains.annotations.NotNull p2: kotlin.coroutines.Continuation): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.coroutines.AllowSuspendExtensions
|
||||
public final class lib/Controller {
|
||||
public method <init>(): void
|
||||
public final @org.jetbrains.annotations.Nullable method inlineSuspendHere(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final @org.jetbrains.annotations.Nullable method suspendHere(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
}
|
||||
|
||||
|
||||
public final class lib/ControllerKt {
|
||||
public final static @org.jetbrains.annotations.Nullable method inlineSuspendExtension(@org.jetbrains.annotations.NotNull p0: lib.Controller, @org.jetbrains.annotations.NotNull p1: java.lang.String, @org.jetbrains.annotations.NotNull p2: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method suspendExtension(@org.jetbrains.annotations.NotNull p0: lib.Controller, @org.jetbrains.annotations.NotNull p1: java.lang.String, @org.jetbrains.annotations.NotNull p2: kotlin.coroutines.Continuation): java.lang.Object
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
@kotlin.coroutines.AllowSuspendExtensions
|
||||
public final class Controller {
|
||||
public method <init>(): void
|
||||
public final @org.jetbrains.annotations.Nullable method inlineSuspendHere(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final @org.jetbrains.annotations.Nullable method suspendHere(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
}
|
||||
|
||||
|
||||
public final class CoroutineUtilKt {
|
||||
public final static @org.jetbrains.annotations.NotNull method handleExceptionContinuation(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1): kotlin.coroutines.Continuation
|
||||
public final static @org.jetbrains.annotations.NotNull method handleResultContinuation(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1): kotlin.coroutines.Continuation
|
||||
}
|
||||
|
||||
|
||||
public final class EmptyContinuation {
|
||||
public final static field INSTANCE: EmptyContinuation
|
||||
private method <init>(): void
|
||||
public method resume(@org.jetbrains.annotations.Nullable p0: java.lang.Object): void
|
||||
public method resumeWithException(@org.jetbrains.annotations.NotNull p0: java.lang.Throwable): void
|
||||
}
|
||||
|
||||
|
||||
public final class SuspendExtensionKt {
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
public final static method builder(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function2): void
|
||||
public final static @org.jetbrains.annotations.Nullable method inlineSuspendExtension(@org.jetbrains.annotations.NotNull p0: Controller, @org.jetbrains.annotations.NotNull p1: java.lang.String, @org.jetbrains.annotations.NotNull p2: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.Nullable method suspendExtension(@org.jetbrains.annotations.NotNull p0: Controller, @org.jetbrains.annotations.NotNull p1: java.lang.String, @org.jetbrains.annotations.NotNull p2: kotlin.coroutines.Continuation): java.lang.Object
|
||||
}
|
||||
-12
@@ -4727,12 +4727,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("suspendExtension.kt")
|
||||
public void testSuspendExtension() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendExtension.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("suspendFromInlineLambda.kt")
|
||||
public void testSuspendFromInlineLambda() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt");
|
||||
@@ -4938,12 +4932,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/simple.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("suspendExtension.kt")
|
||||
public void testSuspendExtension() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/suspendExtension.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding")
|
||||
|
||||
@@ -4727,12 +4727,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("suspendExtension.kt")
|
||||
public void testSuspendExtension() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendExtension.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("suspendFromInlineLambda.kt")
|
||||
public void testSuspendFromInlineLambda() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt");
|
||||
@@ -4938,12 +4932,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/simple.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("suspendExtension.kt")
|
||||
public void testSuspendExtension() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/suspendExtension.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding")
|
||||
|
||||
-12
@@ -4727,12 +4727,6 @@ public class LightAnalysisModeCodegenTestGenerated extends AbstractLightAnalysis
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("suspendExtension.kt")
|
||||
public void testSuspendExtension() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendExtension.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("suspendFromInlineLambda.kt")
|
||||
public void testSuspendFromInlineLambda() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt");
|
||||
@@ -4938,12 +4932,6 @@ public class LightAnalysisModeCodegenTestGenerated extends AbstractLightAnalysis
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/simple.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("suspendExtension.kt")
|
||||
public void testSuspendExtension() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/suspendExtension.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding")
|
||||
|
||||
@@ -33,15 +33,6 @@ public interface Continuation<in P> {
|
||||
public fun resumeWithException(exception: Throwable)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Specifies that suspend extensions with a receiver based on corresponding controller class are allowed to be declared
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
public annotation class AllowSuspendExtensions
|
||||
|
||||
/**
|
||||
* This value can be used as a return value of [kotlin.coroutines.maySuspendWithCurrentContinuation] `body` argument to state that
|
||||
* the execution was suspended and will not return any result immediately.
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
<node text="Retention (kotlin.annotation)"/>
|
||||
<node text="Repeatable (kotlin.annotation)"/>
|
||||
<node text="MustBeDocumented (kotlin.annotation)"/>
|
||||
<node text="AllowSuspendExtensions (kotlin.coroutines)"/>
|
||||
<node text="ExtensionFunctionType (kotlin)"/>
|
||||
<node text="Metadata (kotlin)"/>
|
||||
<node text="DslMarker (kotlin)"/>
|
||||
|
||||
-12
@@ -5538,12 +5538,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("suspendExtension.kt")
|
||||
public void testSuspendExtension() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendExtension.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("suspendFromInlineLambda.kt")
|
||||
public void testSuspendFromInlineLambda() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendFromInlineLambda.kt");
|
||||
@@ -5743,12 +5737,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/simple.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("suspendExtension.kt")
|
||||
public void testSuspendExtension() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/multiModule/suspendExtension.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/coroutines/stackUnwinding")
|
||||
|
||||
@@ -179,9 +179,6 @@ public abstract class kotlin/collections/ShortIterator : java/util/Iterator, kot
|
||||
public fun remove ()V
|
||||
}
|
||||
|
||||
public abstract interface annotation class kotlin/coroutines/AllowSuspendExtensions : java/lang/annotation/Annotation {
|
||||
}
|
||||
|
||||
public abstract interface class kotlin/coroutines/Continuation {
|
||||
public abstract fun resume (Ljava/lang/Object;)V
|
||||
public abstract fun resumeWithException (Ljava/lang/Throwable;)V
|
||||
|
||||
Reference in New Issue
Block a user