IR: copy context receiver parameters count in FakeOverrideCopier
#KT-63430 Fixed
This commit is contained in:
committed by
Space Team
parent
fc64e30829
commit
54705e5afc
+6
@@ -18351,6 +18351,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt58476.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt63430.kt")
|
||||
public void testKt63430() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt63430.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overload.kt")
|
||||
public void testOverload() throws Exception {
|
||||
|
||||
+6
@@ -18351,6 +18351,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt58476.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt63430.kt")
|
||||
public void testKt63430() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt63430.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overload.kt")
|
||||
public void testOverload() throws Exception {
|
||||
|
||||
+6
@@ -18280,6 +18280,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt58476.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt63430.kt")
|
||||
public void testKt63430() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt63430.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overload.kt")
|
||||
public void testOverload() throws Exception {
|
||||
|
||||
+6
@@ -18280,6 +18280,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt58476.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt63430.kt")
|
||||
public void testKt63430() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt63430.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overload.kt")
|
||||
public void testOverload() throws Exception {
|
||||
|
||||
+6
@@ -18280,6 +18280,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt58476.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt63430.kt")
|
||||
public void testKt63430() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt63430.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overload.kt")
|
||||
public void testOverload() throws Exception {
|
||||
|
||||
@@ -35,6 +35,7 @@ class FakeOverrideCopier(
|
||||
isInfix = declaration.isInfix,
|
||||
isExternal = declaration.isExternal,
|
||||
).apply {
|
||||
contextReceiverParametersCount = declaration.contextReceiverParametersCount
|
||||
transformAnnotations(declaration)
|
||||
copyTypeParametersFrom(declaration)
|
||||
typeRemapper.withinScope(this) {
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// WITH_STDLIB
|
||||
|
||||
abstract class A {
|
||||
context(C)
|
||||
fun P.foo(): String = result
|
||||
}
|
||||
|
||||
class B : A() {
|
||||
val p = P()
|
||||
|
||||
context(C)
|
||||
fun test(): String =
|
||||
p.run {
|
||||
foo()
|
||||
}
|
||||
}
|
||||
|
||||
class P
|
||||
class C(val result: String)
|
||||
|
||||
fun box(): String =
|
||||
with(C("OK")) {
|
||||
B().test()
|
||||
}
|
||||
+6
@@ -18280,6 +18280,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt58476.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt63430.kt")
|
||||
public void testKt63430() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt63430.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overload.kt")
|
||||
public void testOverload() throws Exception {
|
||||
|
||||
+6
@@ -18280,6 +18280,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt58476.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt63430.kt")
|
||||
public void testKt63430() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt63430.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overload.kt")
|
||||
public void testOverload() throws Exception {
|
||||
|
||||
+5
@@ -15169,6 +15169,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt58476.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt63430.kt")
|
||||
public void testKt63430() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt63430.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("overload.kt")
|
||||
public void testOverload() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/extensionFunctions/contextReceivers/overload.kt");
|
||||
|
||||
Reference in New Issue
Block a user