[K/N] Make classes generated from λs that use generic parameters generic
Previously, a function reference that used generic parameters from its outer scope was lowered into a top-level non-generic subclass of `FunctionN`, with `FunctionN` type arguments referencing type parameters not present in the scope anymore. This sometimes resulted in generating malformed mangled names. From now on the generated subclass of `FunctionN` is generic. The needed type arguments are passed upon instantiation, when the relevant generic parameters are present in the scope.
This commit is contained in:
committed by
Space Team
parent
0e1350f464
commit
4a2a77d9b9
+6
@@ -4547,6 +4547,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/closures/capturedLocalGenericFun.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("closureCapturingGenericParam.kt")
|
||||
public void testClosureCapturingGenericParam() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/closures/closureCapturingGenericParam.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("closureInsideConstrucor.kt")
|
||||
public void testClosureInsideConstrucor() throws Exception {
|
||||
|
||||
+6
@@ -4607,6 +4607,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/closures/capturedLocalGenericFun.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("closureCapturingGenericParam.kt")
|
||||
public void testClosureCapturingGenericParam() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/closures/closureCapturingGenericParam.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("closureInsideConstrucor.kt")
|
||||
public void testClosureInsideConstrucor() throws Exception {
|
||||
|
||||
+6
@@ -4607,6 +4607,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/closures/capturedLocalGenericFun.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("closureCapturingGenericParam.kt")
|
||||
public void testClosureCapturingGenericParam() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/closures/closureCapturingGenericParam.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("closureInsideConstrucor.kt")
|
||||
public void testClosureInsideConstrucor() throws Exception {
|
||||
|
||||
+5
@@ -4067,6 +4067,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
runTest("compiler/testData/codegen/box/closures/capturedLocalGenericFun.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("closureCapturingGenericParam.kt")
|
||||
public void testClosureCapturingGenericParam() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/closures/closureCapturingGenericParam.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("closureInsideConstrucor.kt")
|
||||
public void testClosureInsideConstrucor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/closures/closureInsideConstrucor.kt");
|
||||
|
||||
Reference in New Issue
Block a user