Load Java overrides of Kotlin suspend functions as suspend, too

There's still some blind spots:
- Covariant overrides in Java (KT-25036)
- Current implementation assumes that when language version is 1.3 every suspend function
reference only release-coroutines-package Continuation
(we need to check if it's a correct statement)

 #KT-24848 Fixed
 #KT-25036 Open
This commit is contained in:
Denis Zharkov
2018-06-22 10:42:02 +03:00
parent 0fc9bb3f4a
commit 3b968351bb
24 changed files with 646 additions and 47 deletions
@@ -19,8 +19,8 @@ import org.jetbrains.kotlin.codegen.state.GenerationState
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper
import org.jetbrains.kotlin.codegen.topLevelClassAsmType
import org.jetbrains.kotlin.codegen.topLevelClassInternalName
import org.jetbrains.kotlin.coroutines.isSuspendLambda
import org.jetbrains.kotlin.config.*
import org.jetbrains.kotlin.coroutines.isSuspendLambda
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.Annotations
import org.jetbrains.kotlin.descriptors.impl.AnonymousFunctionDescriptor
@@ -240,7 +240,7 @@ fun <D : FunctionDescriptor> getOrCreateJvmSuspendFunctionView(
setReturnType(function.builtIns.nullableAnyType)
setValueParameters(it.valueParameters + continuationParameter)
if (dropSuspend) {
setDropSuspend()
setIsSuspend(false)
}
putUserData(INITIAL_DESCRIPTOR_FOR_SUSPEND_FUNCTION, it)
}
@@ -475,4 +475,4 @@ fun FunctionDescriptor.isSuspendLambdaOrLocalFunction() = this.isSuspend && when
is AnonymousFunctionDescriptor -> this.isSuspendLambda
is SimpleFunctionDescriptor -> this.visibility == Visibilities.LOCAL
else -> false
}
}
@@ -36,6 +36,7 @@ import org.jetbrains.kotlin.load.java.InternalFlexibleTypeTransformer
import org.jetbrains.kotlin.load.java.JavaClassFinderImpl
import org.jetbrains.kotlin.load.java.JavaClassesTracker
import org.jetbrains.kotlin.load.java.components.*
import org.jetbrains.kotlin.load.java.lazy.JavaResolverSettings
import org.jetbrains.kotlin.load.java.lazy.ModuleClassResolver
import org.jetbrains.kotlin.load.kotlin.DeserializationComponentsForJava
import org.jetbrains.kotlin.load.kotlin.VirtualFileFinderFactory
@@ -115,6 +116,9 @@ fun createContainerForLazyResolveWithJava(
}
useInstance(javaClassTracker ?: JavaClassesTracker.Default)
useInstance(
JavaResolverSettings.create(isReleaseCoroutines = languageVersionSettings.supportsFeature(LanguageFeature.ReleaseCoroutines))
)
targetEnvironment.configure(this)
@@ -0,0 +1,49 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// WITH_COROUTINES
// COMMON_COROUTINES_TEST
// FILE: I.kt
interface I {
suspend fun foo(x: Int): String
suspend fun bar(x: Int): String
}
// FILE: JavaClass.java
public class JavaClass implements I {
@Override
public String foo(int x, COROUTINES_PACKAGE.Continuation<? super String> continuation) {
return "O";
}
@Override
public Object bar(int x, COROUTINES_PACKAGE.Continuation<? super String> continuation) {
return foo(x, continuation);
}
}
// FILE: main.kt
import helpers.*
import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.*
class K : JavaClass() {
override suspend fun foo(x: Int): String = super.foo(x) + suspendCoroutine { it.resume("K") }
}
fun builder(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation)
}
fun box(): String {
var result = "fail"
builder {
// Changing the call to 'K().bar(1)' doesn't work because of KT-25036
result = K().foo(1)
}
return result
}
@@ -0,0 +1,39 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// WITH_COROUTINES
// COMMON_COROUTINES_TEST
// FILE: I.kt
interface I {
suspend fun foo(x: Int): String
}
// FILE: JavaClass.java
public class JavaClass implements I {
@Override
public Object foo(int x, COROUTINES_PACKAGE.Continuation<? super String> continuation) {
continuation.resume("OK");
return COROUTINES_PACKAGE.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED();
}
}
// FILE: main.kt
import helpers.*
import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.*
fun builder(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation)
}
fun box(): String {
var result = "fail"
builder {
result = JavaClass().foo(1)
}
return result
}
@@ -0,0 +1,48 @@
// COMMON_COROUTINES_TEST
// FILE: I.kt
interface I {
suspend fun foo(x: Int): String
}
// FILE: JavaClass.java
public class JavaClass implements I {
@Override
public String foo(int x, COROUTINES_PACKAGE.Continuation<String> continuation) {
return null;
}
}
// FILE: main.kt
import COROUTINES_PACKAGE.Continuation
class K1 : JavaClass()
class K2 : JavaClass() {
override suspend fun foo(x: Int): String = ""
}
class K3 : JavaClass() {
<!NOTHING_TO_OVERRIDE!>override<!> fun foo(x: Int, y: Continuation<String>): Any? = null
}
fun builder(<!UNUSED_PARAMETER!>block<!>: suspend () -> Unit) {}
fun main(x: Continuation<String>) {
JavaClass().<!ILLEGAL_SUSPEND_FUNCTION_CALL!>foo<!>(5, <!TOO_MANY_ARGUMENTS!>x<!>)
K1().<!ILLEGAL_SUSPEND_FUNCTION_CALL!>foo<!>(6, <!TOO_MANY_ARGUMENTS!>x<!>)
K2().<!ILLEGAL_SUSPEND_FUNCTION_CALL!>foo<!>(7, <!TOO_MANY_ARGUMENTS!>x<!>)
K3().foo(8, x)
builder {
JavaClass().foo(1)
K1().foo(2)
K2().foo(3)
K3().foo(4)
JavaClass().foo(5, <!TOO_MANY_ARGUMENTS!>x<!>)
K1().foo(6, <!TOO_MANY_ARGUMENTS!>x<!>)
K2().foo(7, <!TOO_MANY_ARGUMENTS!>x<!>)
K3().foo(8, x)
}
}
@@ -0,0 +1,44 @@
package
public fun builder(/*0*/ block: suspend () -> kotlin.Unit): kotlin.Unit
public fun main(/*0*/ x: COROUTINES_PACKAGE.Continuation<kotlin.String>): kotlin.Unit
public interface I {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract suspend fun foo(/*0*/ x: kotlin.Int): kotlin.String
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public open class JavaClass : I {
public constructor JavaClass()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@java.lang.Override public open override /*1*/ suspend fun foo(/*0*/ x: kotlin.Int): kotlin.String
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class K1 : JavaClass {
public constructor K1()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@java.lang.Override public open override /*1*/ suspend /*fake_override*/ fun foo(/*0*/ x: kotlin.Int): kotlin.String
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class K2 : JavaClass {
public constructor K2()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ suspend fun foo(/*0*/ x: kotlin.Int): kotlin.String
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class K3 : JavaClass {
public constructor K3()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@java.lang.Override public open override /*1*/ suspend /*fake_override*/ fun foo(/*0*/ x: kotlin.Int): kotlin.String
public open fun foo(/*0*/ x: kotlin.Int, /*1*/ y: COROUTINES_PACKAGE.Continuation<kotlin.String>): kotlin.Any?
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -0,0 +1,51 @@
// COMMON_COROUTINES_TEST
// FILE: I.kt
interface I {
suspend fun foo(x: Int): String
}
// FILE: BaseJavaClass.java
public class BaseJavaClass {
public Object foo(int x, COROUTINES_PACKAGE.Continuation<String> continuation) {
return null;
}
}
// FILE: JavaClass.java
public class JavaClass extends BaseJavaClass implements I {
}
// FILE: main.kt
import COROUTINES_PACKAGE.Continuation
class K1 : JavaClass()
class K2 : JavaClass() {
override suspend fun foo(x: Int): String = ""
}
class K3 : JavaClass() {
<!NOTHING_TO_OVERRIDE!>override<!> fun foo(x: Int, y: Continuation<String>): Any? = null
}
fun builder(<!UNUSED_PARAMETER!>block<!>: suspend () -> Unit) {}
fun main(x: Continuation<String>) {
JavaClass().<!ILLEGAL_SUSPEND_FUNCTION_CALL!>foo<!>(5, <!TOO_MANY_ARGUMENTS!>x<!>)
K1().<!ILLEGAL_SUSPEND_FUNCTION_CALL!>foo<!>(6, <!TOO_MANY_ARGUMENTS!>x<!>)
K2().<!ILLEGAL_SUSPEND_FUNCTION_CALL!>foo<!>(7, <!TOO_MANY_ARGUMENTS!>x<!>)
K3().foo(8, x)
builder {
JavaClass().foo(1)
K1().foo(2)
K2().foo(3)
K3().foo(4)
JavaClass().foo(5, <!TOO_MANY_ARGUMENTS!>x<!>)
K1().foo(6, <!TOO_MANY_ARGUMENTS!>x<!>)
K2().foo(7, <!TOO_MANY_ARGUMENTS!>x<!>)
K3().foo(8, x)
}
}
@@ -0,0 +1,52 @@
package
public fun builder(/*0*/ block: suspend () -> kotlin.Unit): kotlin.Unit
public fun main(/*0*/ x: COROUTINES_PACKAGE.Continuation<kotlin.String>): kotlin.Unit
public open class BaseJavaClass {
public constructor BaseJavaClass()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open fun foo(/*0*/ x: kotlin.Int, /*1*/ continuation: COROUTINES_PACKAGE.Continuation<kotlin.String!>!): kotlin.Any!
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface I {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract suspend fun foo(/*0*/ x: kotlin.Int): kotlin.String
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public open class JavaClass : BaseJavaClass, I {
public constructor JavaClass()
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*2*/ suspend /*fake_override*/ fun foo(/*0*/ x: kotlin.Int): kotlin.String
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class K1 : JavaClass {
public constructor K1()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ suspend /*fake_override*/ fun foo(/*0*/ x: kotlin.Int): kotlin.String
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class K2 : JavaClass {
public constructor K2()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ suspend fun foo(/*0*/ x: kotlin.Int): kotlin.String
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class K3 : JavaClass {
public constructor K3()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ suspend /*fake_override*/ fun foo(/*0*/ x: kotlin.Int): kotlin.String
public open fun foo(/*0*/ x: kotlin.Int, /*1*/ y: COROUTINES_PACKAGE.Continuation<kotlin.String>): kotlin.Any?
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -0,0 +1,48 @@
// COMMON_COROUTINES_TEST
// FILE: I.kt
interface I {
suspend fun foo(x: Int): String
}
// FILE: JavaClass.java
public class JavaClass implements I {
@Override
public Object foo(int x, COROUTINES_PACKAGE.Continuation<String> continuation) {
return null;
}
}
// FILE: main.kt
import COROUTINES_PACKAGE.Continuation
class K1 : JavaClass()
class K2 : JavaClass() {
override suspend fun foo(x: Int): String = ""
}
class K3 : JavaClass() {
<!NOTHING_TO_OVERRIDE!>override<!> fun foo(x: Int, y: Continuation<String>): Any? = null
}
fun builder(<!UNUSED_PARAMETER!>block<!>: suspend () -> Unit) {}
fun main(x: Continuation<String>) {
JavaClass().<!ILLEGAL_SUSPEND_FUNCTION_CALL!>foo<!>(5, <!TOO_MANY_ARGUMENTS!>x<!>)
K1().<!ILLEGAL_SUSPEND_FUNCTION_CALL!>foo<!>(6, <!TOO_MANY_ARGUMENTS!>x<!>)
K2().<!ILLEGAL_SUSPEND_FUNCTION_CALL!>foo<!>(7, <!TOO_MANY_ARGUMENTS!>x<!>)
K3().foo(8, x)
builder {
JavaClass().foo(1)
K1().foo(2)
K2().foo(3)
K3().foo(4)
JavaClass().foo(5, <!TOO_MANY_ARGUMENTS!>x<!>)
K1().foo(6, <!TOO_MANY_ARGUMENTS!>x<!>)
K2().foo(7, <!TOO_MANY_ARGUMENTS!>x<!>)
K3().foo(8, x)
}
}
@@ -0,0 +1,44 @@
package
public fun builder(/*0*/ block: suspend () -> kotlin.Unit): kotlin.Unit
public fun main(/*0*/ x: COROUTINES_PACKAGE.Continuation<kotlin.String>): kotlin.Unit
public interface I {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract suspend fun foo(/*0*/ x: kotlin.Int): kotlin.String
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public open class JavaClass : I {
public constructor JavaClass()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@java.lang.Override public open override /*1*/ suspend fun foo(/*0*/ x: kotlin.Int): kotlin.String
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class K1 : JavaClass {
public constructor K1()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@java.lang.Override public open override /*1*/ suspend /*fake_override*/ fun foo(/*0*/ x: kotlin.Int): kotlin.String
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class K2 : JavaClass {
public constructor K2()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ suspend fun foo(/*0*/ x: kotlin.Int): kotlin.String
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class K3 : JavaClass {
public constructor K3()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@java.lang.Override public open override /*1*/ suspend /*fake_override*/ fun foo(/*0*/ x: kotlin.Int): kotlin.String
public open fun foo(/*0*/ x: kotlin.Int, /*1*/ y: COROUTINES_PACKAGE.Continuation<kotlin.String>): kotlin.Any?
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -25,7 +25,7 @@ interface C : A {
}
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class D<!> : J {
<!ACCIDENTAL_OVERRIDE!>suspend override fun foo()<!> {
suspend override fun foo() {
}
}
@@ -29,7 +29,6 @@ public final class D : J {
public abstract override /*1*/ /*fake_override*/ fun bar(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ suspend fun foo(): kotlin.Unit
public abstract override /*1*/ /*fake_override*/ fun foo(/*0*/ y: kotlin.coroutines.experimental.Continuation<kotlin.Unit!>!): kotlin.Any!
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -37,8 +36,7 @@ public final class D : J {
public interface J : A {
public abstract override /*1*/ /*fake_override*/ fun bar(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ suspend /*fake_override*/ fun foo(): kotlin.Unit
public abstract fun foo(/*0*/ y: kotlin.coroutines.experimental.Continuation<kotlin.Unit!>!): kotlin.Any!
public abstract override /*1*/ suspend fun foo(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -5975,6 +5975,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("suspendCovariantJavaOverrides.kt")
public void testSuspendCovariantJavaOverrides_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendCovariantJavaOverrides.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental");
}
@TestMetadata("suspendCovariantJavaOverrides.kt")
public void testSuspendCovariantJavaOverrides_1_3() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendCovariantJavaOverrides.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("suspendDefaultImpl.kt")
public void testSuspendDefaultImpl_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendDefaultImpl.kt");
@@ -6071,6 +6083,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("suspendJavaOverrides.kt")
public void testSuspendJavaOverrides_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendJavaOverrides.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental");
}
@TestMetadata("suspendJavaOverrides.kt")
public void testSuspendJavaOverrides_1_3() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendJavaOverrides.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("suspensionInsideSafeCallWithElvis.kt")
public void testSuspensionInsideSafeCallWithElvis_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCallWithElvis.kt");
@@ -1502,6 +1502,18 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineUnavailableWithOldAPI.kt");
}
@TestMetadata("suspendCovarianJavaOverride.kt")
public void testSuspendCovarianJavaOverride_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCovarianJavaOverride.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental");
}
@TestMetadata("suspendCovarianJavaOverride.kt")
public void testSuspendCovarianJavaOverride_1_3() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCovarianJavaOverride.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("suspendDestructuring.kt")
public void testSuspendDestructuring() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendDestructuring.kt");
@@ -1524,6 +1536,30 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("suspendJavaImplementationFromDifferentClass.kt")
public void testSuspendJavaImplementationFromDifferentClass_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaImplementationFromDifferentClass.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental");
}
@TestMetadata("suspendJavaImplementationFromDifferentClass.kt")
public void testSuspendJavaImplementationFromDifferentClass_1_3() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaImplementationFromDifferentClass.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("suspendJavaOverrides.kt")
public void testSuspendJavaOverrides_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaOverrides.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental");
}
@TestMetadata("suspendJavaOverrides.kt")
public void testSuspendJavaOverrides_1_3() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaOverrides.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("suspendLambda.kt")
public void testSuspendLambda_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendLambda.kt");
@@ -1502,6 +1502,18 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineUnavailableWithOldAPI.kt");
}
@TestMetadata("suspendCovarianJavaOverride.kt")
public void testSuspendCovarianJavaOverride_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCovarianJavaOverride.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental");
}
@TestMetadata("suspendCovarianJavaOverride.kt")
public void testSuspendCovarianJavaOverride_1_3() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCovarianJavaOverride.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("suspendDestructuring.kt")
public void testSuspendDestructuring() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendDestructuring.kt");
@@ -1524,6 +1536,30 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("suspendJavaImplementationFromDifferentClass.kt")
public void testSuspendJavaImplementationFromDifferentClass_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaImplementationFromDifferentClass.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental");
}
@TestMetadata("suspendJavaImplementationFromDifferentClass.kt")
public void testSuspendJavaImplementationFromDifferentClass_1_3() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaImplementationFromDifferentClass.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("suspendJavaOverrides.kt")
public void testSuspendJavaOverrides_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaOverrides.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental");
}
@TestMetadata("suspendJavaOverrides.kt")
public void testSuspendJavaOverrides_1_3() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendJavaOverrides.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("suspendLambda.kt")
public void testSuspendLambda_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendLambda.kt");
@@ -5975,6 +5975,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("suspendCovariantJavaOverrides.kt")
public void testSuspendCovariantJavaOverrides_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendCovariantJavaOverrides.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental");
}
@TestMetadata("suspendCovariantJavaOverrides.kt")
public void testSuspendCovariantJavaOverrides_1_3() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendCovariantJavaOverrides.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("suspendDefaultImpl.kt")
public void testSuspendDefaultImpl_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendDefaultImpl.kt");
@@ -6071,6 +6083,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("suspendJavaOverrides.kt")
public void testSuspendJavaOverrides_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendJavaOverrides.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental");
}
@TestMetadata("suspendJavaOverrides.kt")
public void testSuspendJavaOverrides_1_3() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendJavaOverrides.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("suspensionInsideSafeCallWithElvis.kt")
public void testSuspensionInsideSafeCallWithElvis_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCallWithElvis.kt");
@@ -5975,6 +5975,18 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("suspendCovariantJavaOverrides.kt")
public void testSuspendCovariantJavaOverrides_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendCovariantJavaOverrides.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental");
}
@TestMetadata("suspendCovariantJavaOverrides.kt")
public void testSuspendCovariantJavaOverrides_1_3() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendCovariantJavaOverrides.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("suspendDefaultImpl.kt")
public void testSuspendDefaultImpl_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendDefaultImpl.kt");
@@ -6071,6 +6083,18 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("suspendJavaOverrides.kt")
public void testSuspendJavaOverrides_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendJavaOverrides.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental");
}
@TestMetadata("suspendJavaOverrides.kt")
public void testSuspendJavaOverrides_1_3() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspendJavaOverrides.kt");
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
}
@TestMetadata("suspensionInsideSafeCallWithElvis.kt")
public void testSuspensionInsideSafeCallWithElvis_1_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/suspensionInsideSafeCallWithElvis.kt");