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:
+36
@@ -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");
|
||||
|
||||
compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java
Generated
+36
@@ -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");
|
||||
|
||||
+24
@@ -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");
|
||||
|
||||
+24
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user