Fixed testdata.
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
||||
// IGNORE_BACKEND: JS
|
||||
|
||||
// WITH_REFLECT
|
||||
|
||||
import kotlin.test.assertTrue
|
||||
import kotlin.test.assertFalse
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
inline fun Unit.foo(
|
||||
noinline coroutine x: Unit.() -> Continuation<Unit>,
|
||||
vararg vararg: Unit
|
||||
) {}
|
||||
|
||||
fun box(): String {
|
||||
val p = Unit::foo.parameters
|
||||
|
||||
assertEquals(2, p.size)
|
||||
|
||||
assertFalse(p[0].isVararg)
|
||||
assertTrue(p[0].isCoroutine)
|
||||
|
||||
assertTrue(p[1].isVararg)
|
||||
assertFalse(p[1].isCoroutine)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+2
-1
@@ -2,6 +2,7 @@
|
||||
// FULL_JDK
|
||||
|
||||
import java.util.concurrent.CompletableFuture
|
||||
import kotlin.coroutines.*
|
||||
|
||||
fun foo(): CompletableFuture<String> = CompletableFuture.supplyAsync { "foo" }
|
||||
fun bar(v: String): CompletableFuture<String> = CompletableFuture.supplyAsync { "bar with $v" }
|
||||
@@ -43,7 +44,7 @@ fun box(): String {
|
||||
|
||||
// LIBRARY CODE
|
||||
|
||||
fun <T> async(c: @Suspend() (() -> T)): CompletableFuture<T> {
|
||||
fun <T> async(c: suspend () -> T): CompletableFuture<T> {
|
||||
val future = CompletableFuture<T>()
|
||||
c.startCoroutine(object : Continuation<T> {
|
||||
override fun resume(data: T) {
|
||||
|
||||
+3
-2
@@ -2,6 +2,7 @@
|
||||
// FULL_JDK
|
||||
|
||||
import java.util.concurrent.CompletableFuture
|
||||
import kotlin.coroutines.*
|
||||
|
||||
fun exception(v: String): CompletableFuture<String> = CompletableFuture.supplyAsync { throw RuntimeException(v) }
|
||||
|
||||
@@ -40,9 +41,9 @@ fun box(): String {
|
||||
return "No exception"
|
||||
}
|
||||
|
||||
fun <T> async(c: @Suspend() (() -> T)): CompletableFuture<T> {
|
||||
fun <T> async(c: suspend () -> T): CompletableFuture<T> {
|
||||
val future = CompletableFuture<T>()
|
||||
c.startContinuation(object : Continuation<T> {
|
||||
c.startCoroutine(object : Continuation<T> {
|
||||
override fun resume(data: T) {
|
||||
future.complete(data)
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
public final class Controller {
|
||||
private @org.jetbrains.annotations.NotNull field log: java.lang.String
|
||||
private field resumeIndex: int
|
||||
@@ -17,15 +18,15 @@ public final class CoroutineUtilKt {
|
||||
}
|
||||
|
||||
|
||||
public final class DispatchResumeKt {
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
public final static @org.jetbrains.annotations.NotNull method test(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function2): java.lang.String
|
||||
}
|
||||
|
||||
|
||||
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 InterceptResumeKt {
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
public final static @org.jetbrains.annotations.NotNull method test(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function2): java.lang.String
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user