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:
+18
@@ -996,6 +996,24 @@ public class FirLoadCompiledKotlinGenerated extends AbstractFirLoadCompiledKotli
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/contextReceivers")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class ContextReceivers extends AbstractFirLoadCompiledKotlin {
|
||||
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)
|
||||
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
context(R|test/A|)
|
||||
public final fun g(): R|kotlin/Unit|
|
||||
|
||||
context(R|test/B|)
|
||||
public final val h: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
public abstract interface A : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
public abstract interface B : R|kotlin/Any| {
|
||||
}
|
||||
|
||||
context(R|test/A|)
|
||||
public final class C : R|kotlin/Any| {
|
||||
context(R|test/B|)
|
||||
public final fun f(): R|kotlin/Unit|
|
||||
|
||||
public constructor(): R|test/C|
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user