Fix annotation deserialization on suspend functions

Use proper initial/frontend version of suspend descriptor
when writing METHOD_FOR_FUNCTION, because serializer uses this version

Also this commit contains adjustments of neighboring code to the describe
change

 #KT-16093 Fixed
This commit is contained in:
Denis Zharkov
2017-02-03 16:44:16 +03:00
parent 2516583ecf
commit 2d88419c38
10 changed files with 83 additions and 8 deletions
@@ -791,6 +791,18 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
doTest(fileName);
}
@TestMetadata("suspendCoroutineUnavailableWithNewAPI.kt")
public void testSuspendCoroutineUnavailableWithNewAPI() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineUnavailableWithNewAPI.kt");
doTest(fileName);
}
@TestMetadata("suspendCoroutineUnavailableWithOldAPI.kt")
public void testSuspendCoroutineUnavailableWithOldAPI() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineUnavailableWithOldAPI.kt");
doTest(fileName);
}
@TestMetadata("suspendDestructuring.kt")
public void testSuspendDestructuring() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendDestructuring.kt");
@@ -4944,6 +4944,21 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest {
}
}
@TestMetadata("compiler/testData/loadJava/compiledKotlinWithStdlib/coroutines")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Coroutines extends AbstractLoadJavaTest {
public void testAllFilesPresentInCoroutines() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlinWithStdlib/coroutines"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("annotatedSuspendFun.kt")
public void testAnnotatedSuspendFun() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlinWithStdlib/coroutines/annotatedSuspendFun.kt");
doTestCompiledKotlinWithStdlib(fileName);
}
}
@TestMetadata("compiler/testData/loadJava/compiledKotlinWithStdlib/mutability")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)