Fix metadata deserialization for context receivers with type table

In DeserializedClassDescriptor and MemberDeserializer, only the
`contextReceiverTypeList` field was used, and not
`contextReceiverTypeIdList` which is used when `-Xuse-type-table` is
enabled. The convention is to use a bunch of utilities declared in
`protoTypeTableUtil.kt` which deal with both methods of reading types.
Also, simplify the deserialization code in FIR (which was correct for
some reason).
This commit is contained in:
Alexander Udalov
2022-06-14 00:16:59 +02:00
parent 71f6c0b1b2
commit 08f18c2940
13 changed files with 178 additions and 38 deletions
@@ -998,6 +998,24 @@ public class JvmRuntimeDescriptorLoaderTestGenerated extends AbstractJvmRuntimeD
}
}
@TestMetadata("compiler/testData/loadJava/compiledKotlin/contextReceivers")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ContextReceivers extends AbstractJvmRuntimeDescriptorLoaderTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInContextReceivers() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/contextReceivers"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@TestMetadata("SimpleContextReceivers.kt")
public void testSimpleContextReceivers() throws Exception {
runTest("compiler/testData/loadJava/compiledKotlin/contextReceivers/SimpleContextReceivers.kt");
}
}
@TestMetadata("compiler/testData/loadJava/compiledKotlin/coroutines")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)