[FIR] Fix deserialization of generic context receivers

We need to pass the local deserialization context so that generic
type parameters can be referenced.

#KT-62607 Fixed
This commit is contained in:
Kirill Rakhman
2023-10-26 15:10:09 +02:00
committed by Space Team
parent 45a1cc1a4a
commit ef78d4b95a
17 changed files with 87 additions and 5 deletions
@@ -926,6 +926,11 @@ public class IncrementalK1JvmJpsTestGenerated extends AbstractIncrementalK1JvmJp
runTest("jps/jps-plugin/testData/incremental/pureKotlin/functionReferencingClass/");
}
@TestMetadata("genericContextReceiver")
public void testGenericContextReceiver() throws Exception {
runTest("jps/jps-plugin/testData/incremental/pureKotlin/genericContextReceiver/");
}
@TestMetadata("independentClasses")
public void testIndependentClasses() throws Exception {
runTest("jps/jps-plugin/testData/incremental/pureKotlin/independentClasses/");
@@ -252,6 +252,11 @@ public class IncrementalK2FirICLightTreeJvmJpsTestGenerated extends AbstractIncr
runTest("jps/jps-plugin/testData/incremental/pureKotlin/functionReferencingClass/");
}
@TestMetadata("genericContextReceiver")
public void testGenericContextReceiver() throws Exception {
runTest("jps/jps-plugin/testData/incremental/pureKotlin/genericContextReceiver/");
}
@TestMetadata("independentClasses")
public void testIndependentClasses() throws Exception {
runTest("jps/jps-plugin/testData/incremental/pureKotlin/independentClasses/");
@@ -252,6 +252,11 @@ public class IncrementalK2JvmJpsTestGenerated extends AbstractIncrementalK2JvmJp
runTest("jps/jps-plugin/testData/incremental/pureKotlin/functionReferencingClass/");
}
@TestMetadata("genericContextReceiver")
public void testGenericContextReceiver() throws Exception {
runTest("jps/jps-plugin/testData/incremental/pureKotlin/genericContextReceiver/");
}
@TestMetadata("independentClasses")
public void testIndependentClasses() throws Exception {
runTest("jps/jps-plugin/testData/incremental/pureKotlin/independentClasses/");
@@ -252,6 +252,11 @@ public class IncrementalK2LightTreeJvmJpsTestGenerated extends AbstractIncrement
runTest("jps/jps-plugin/testData/incremental/pureKotlin/functionReferencingClass/");
}
@TestMetadata("genericContextReceiver")
public void testGenericContextReceiver() throws Exception {
runTest("jps/jps-plugin/testData/incremental/pureKotlin/genericContextReceiver/");
}
@TestMetadata("independentClasses")
public void testIndependentClasses() throws Exception {
runTest("jps/jps-plugin/testData/incremental/pureKotlin/independentClasses/");
@@ -0,0 +1 @@
-XXLanguage:+ContextReceivers
@@ -0,0 +1,8 @@
package test
fun test() {
with("") {
foo()
foo
}
}
@@ -0,0 +1,11 @@
================ Step #1 =================
Cleaning output files:
out/production/module/META-INF/module.kotlin_module
out/production/module/test/BarKt.class
End of files
Compiling files:
src/bar.kt
End of files
Exit code: OK
------------------------------------------
@@ -0,0 +1,7 @@
package test
context(T)
fun <T> foo() {}
context(T)
val <T> T.foo get() = 1