Skip to content

Commit

Permalink
Fixed testdata.
Browse files Browse the repository at this point in the history
  • Loading branch information
erokhins committed Dec 15, 2016
1 parent ab53978 commit d7566d8
Show file tree
Hide file tree
Showing 18 changed files with 115 additions and 141 deletions.
22 changes: 17 additions & 5 deletions compiler/testData/builtin-classes/default/kotlin-coroutines.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
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.PublishedApi internal inline suspend fun </*0*/ T> suspendWithCurrentContinuation(/*0*/ body: (kotlin.coroutines.Continuation<T>) -> kotlin.Any?): T

@kotlin.SinceKotlin(version = "1.1") public interface Continuation</*0*/ in P> {
public abstract fun resume(/*0*/ data: P): kotlin.Unit
@kotlin.SinceKotlin(version = "1.1") public interface Continuation</*0*/ in T> {
public abstract fun resume(/*0*/ value: T): kotlin.Unit
public abstract fun resumeWithException(/*0*/ exception: kotlin.Throwable): kotlin.Unit
}

@kotlin.SinceKotlin(version = "1.1") public object Suspend {
/*primary*/ private constructor Suspend()
@kotlin.SinceKotlin(version = "1.1") public interface ContinuationDispatcher {
public open fun </*0*/ T> dispatchResume(/*0*/ value: T, /*1*/ continuation: kotlin.coroutines.Continuation<T>): kotlin.Boolean
public open fun dispatchResumeWithException(/*0*/ exception: kotlin.Throwable, /*1*/ continuation: kotlin.coroutines.Continuation<*>): kotlin.Boolean
}

@kotlin.SinceKotlin(version = "1.1") public object CoroutineIntrinsics {
/*primary*/ private constructor CoroutineIntrinsics()
@kotlin.SinceKotlin(version = "1.1") public final val SUSPENDED: kotlin.Any
public final fun <get-SUSPENDED>(): kotlin.Any
public final inline suspend fun </*0*/ T> suspendCoroutineOrReturn(/*0*/ block: (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 RestrictsSuspendExtensions : kotlin.Annotation {
/*primary*/ public constructor RestrictsSuspendExtensions()
}
27 changes: 0 additions & 27 deletions compiler/testData/codegen/box/reflection/modifiers/parameters.kt

This file was deleted.

3 changes: 2 additions & 1 deletion compiler/testData/codegen/java8/box/async.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down Expand Up @@ -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) {
Expand Down
5 changes: 3 additions & 2 deletions compiler/testData/codegen/java8/box/asyncException.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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) }

Expand Down Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

public final class Controller {
private @org.jetbrains.annotations.NotNull field log: java.lang.String
private field resumeIndex: int
Expand All @@ -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
}
}
13 changes: 10 additions & 3 deletions compiler/testData/compileKotlinAgainstKotlin/coroutinesBinary.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
// FILE: A.kt
package a

import kotlin.coroutines.*

class Controller {
suspend fun suspendHere() = CoroutineIntrinsics.suspendCoroutineOrReturn<String> { x ->
x.resume("OK")
Suspend
CoroutineIntrinsics.SUSPENDED
}
}

fun builder(coroutine c: Controller.() -> Continuation<Unit>) {
c(Controller()).resume(Unit)
fun builder(c: suspend Controller.() -> Unit) {
c.startCoroutine(Controller(), object : Continuation<Unit> {
override fun resume(value: Unit) {}

override fun resumeWithException(exception: Throwable) {}
})
}

// FILE: B.kt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
package test

fun test1(): suspend () -> Unit = null!!
fun test2(): suspend (Int, String) -> Int = null!!
fun test3(): suspend Int.(String) -> Int = null!!
fun test4(): List<suspend () -> Unit> = null!!
fun test5(): suspend (suspend () -> Unit) -> Unit = null!!
fun test2(): suspend Int.() -> Int = null!!
fun test3(): List<suspend () -> Unit> = null!!
fun test4(): suspend () -> (suspend () -> Unit) = null!!
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package test

public fun test1(): suspend () -> kotlin.Unit
public fun test2(): suspend (kotlin.Int, kotlin.String) -> kotlin.Int
public fun test3(): suspend kotlin.Int.(kotlin.String) -> kotlin.Int
public fun test4(): kotlin.collections.List<suspend () -> kotlin.Unit>
public fun test5(): suspend (suspend () -> kotlin.Unit) -> kotlin.Unit
public fun test2(): suspend kotlin.Int.() -> kotlin.Int
public fun test3(): kotlin.collections.List<suspend () -> kotlin.Unit>
public fun test4(): suspend () -> suspend () -> kotlin.Unit
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import kotlin.coroutines.*

header fun f1()

header fun f2(name: String)
Expand Down Expand Up @@ -32,5 +34,5 @@ header inline fun f19(crossinline s: () -> Unit)
header inline fun f20(s: () -> Unit)
header inline fun f21(noinline s: () -> Unit)
header inline fun f22(s: () -> Unit)
header fun f23(coroutine c: Unit.() -> Continuation<Unit>)
header fun f24(c: Unit.() -> Continuation<Unit>)
header fun f23(c: suspend Unit.() -> Unit)
header fun f24(c: Unit.() -> Unit)
6 changes: 4 additions & 2 deletions compiler/testData/multiplatform/incompatibleCallables/jvm.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import kotlin.coroutines.*

impl fun f1(): String = ""

impl fun f2(otherName: String) {}
Expand Down Expand Up @@ -32,5 +34,5 @@ impl inline fun f19(s: () -> Unit) {}
impl inline fun f20(crossinline s: () -> Unit) {}
impl inline fun f21(s: () -> Unit) {}
impl inline fun f22(noinline s: () -> Unit) {}
impl fun f23(c: Unit.() -> Continuation<Unit>) {}
impl fun f24(coroutine c: Unit.() -> Continuation<Unit>) {}
impl fun f23(c: Unit.() -> Unit) {}
impl fun f24(c: suspend Unit.() -> Unit) {}
Loading

0 comments on commit d7566d8

Please sign in to comment.