From 34a4159a940c8d39108361282bb2b3fb4211ff14 Mon Sep 17 00:00:00 2001 From: Stanislav Erokhin Date: Thu, 15 Dec 2016 03:16:16 +0300 Subject: [PATCH] Added coroutine import to front-end tests. --- .../diagnostics/tests/coroutines/suspendApplicability.kt | 2 ++ .../testData/diagnostics/tests/coroutines/suspendFunctions.kt | 2 ++ .../tests/coroutines/suspendWithCurrentContinuation.kt | 2 ++ .../diagnostics/tests/coroutines/tailCalls/forbidden.kt | 1 + .../tests/coroutines/tailCalls/nothingTypedSuspendFunction.kt | 2 ++ .../testData/diagnostics/tests/coroutines/tailCalls/tryCatch.kt | 1 + .../testData/diagnostics/tests/coroutines/tailCalls/valid.kt | 1 + 7 files changed, 11 insertions(+) diff --git a/compiler/testData/diagnostics/tests/coroutines/suspendApplicability.kt b/compiler/testData/diagnostics/tests/coroutines/suspendApplicability.kt index 50d11d75c39..5bced6f9c3d 100644 --- a/compiler/testData/diagnostics/tests/coroutines/suspendApplicability.kt +++ b/compiler/testData/diagnostics/tests/coroutines/suspendApplicability.kt @@ -1,4 +1,6 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -NOTHING_TO_INLINE +import kotlin.coroutines.* + suspend fun notMember(q: Double) = 1 suspend fun String.wrongExtension(x: Any) = 1 diff --git a/compiler/testData/diagnostics/tests/coroutines/suspendFunctions.kt b/compiler/testData/diagnostics/tests/coroutines/suspendFunctions.kt index 28d0e41966a..e2025e0fa16 100644 --- a/compiler/testData/diagnostics/tests/coroutines/suspendFunctions.kt +++ b/compiler/testData/diagnostics/tests/coroutines/suspendFunctions.kt @@ -1,5 +1,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER // !CHECK_TYPE +import kotlin.coroutines.* + class Controller { suspend fun noParams() { diff --git a/compiler/testData/diagnostics/tests/coroutines/suspendWithCurrentContinuation.kt b/compiler/testData/diagnostics/tests/coroutines/suspendWithCurrentContinuation.kt index eb156286629..2a64a84db47 100644 --- a/compiler/testData/diagnostics/tests/coroutines/suspendWithCurrentContinuation.kt +++ b/compiler/testData/diagnostics/tests/coroutines/suspendWithCurrentContinuation.kt @@ -1,5 +1,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER // !CHECK_TYPE +import kotlin.coroutines.* + class Controller { suspend fun noParams(): Unit = suspendWithCurrentContinuation { if (hashCode() % 2 == 0) { diff --git a/compiler/testData/diagnostics/tests/coroutines/tailCalls/forbidden.kt b/compiler/testData/diagnostics/tests/coroutines/tailCalls/forbidden.kt index be0228355d7..39dc7dcc4a0 100644 --- a/compiler/testData/diagnostics/tests/coroutines/tailCalls/forbidden.kt +++ b/compiler/testData/diagnostics/tests/coroutines/tailCalls/forbidden.kt @@ -1,4 +1,5 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER +import kotlin.coroutines.* fun nonSuspend() {} diff --git a/compiler/testData/diagnostics/tests/coroutines/tailCalls/nothingTypedSuspendFunction.kt b/compiler/testData/diagnostics/tests/coroutines/tailCalls/nothingTypedSuspendFunction.kt index e220301183b..cac9fa549e7 100644 --- a/compiler/testData/diagnostics/tests/coroutines/tailCalls/nothingTypedSuspendFunction.kt +++ b/compiler/testData/diagnostics/tests/coroutines/tailCalls/nothingTypedSuspendFunction.kt @@ -1,4 +1,6 @@ // Tail calls are not allowed to be Nothing typed. See KT-15051 +import kotlin.coroutines.* + suspend fun suspendLogAndThrow(exception: Throwable): Nothing = suspendWithCurrentContinuation { c -> c.resumeWithException(exception) SUSPENDED diff --git a/compiler/testData/diagnostics/tests/coroutines/tailCalls/tryCatch.kt b/compiler/testData/diagnostics/tests/coroutines/tailCalls/tryCatch.kt index 0d79dfa4401..0b8d18d5349 100644 --- a/compiler/testData/diagnostics/tests/coroutines/tailCalls/tryCatch.kt +++ b/compiler/testData/diagnostics/tests/coroutines/tailCalls/tryCatch.kt @@ -1,4 +1,5 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER +import kotlin.coroutines.* fun nonSuspend() {} diff --git a/compiler/testData/diagnostics/tests/coroutines/tailCalls/valid.kt b/compiler/testData/diagnostics/tests/coroutines/tailCalls/valid.kt index d7fcab941b4..ab6504e7d1b 100644 --- a/compiler/testData/diagnostics/tests/coroutines/tailCalls/valid.kt +++ b/compiler/testData/diagnostics/tests/coroutines/tailCalls/valid.kt @@ -1,4 +1,5 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER +import kotlin.coroutines.* suspend fun baz() = 1