[IR] Fix calculation of receiver type for properies in expect/actual context
^KT-62926 Fixed
This commit is contained in:
committed by
Space Team
parent
9cef8a2133
commit
7d685522ce
+6
@@ -35223,6 +35223,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo
|
|||||||
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClassJVM.kt");
|
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClassJVM.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("extensionPropertiesOverloads.kt")
|
||||||
|
public void testExtensionPropertiesOverloads() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/multiplatform/k2/extensionPropertiesOverloads.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("internalOverride.kt")
|
@TestMetadata("internalOverride.kt")
|
||||||
public void testInternalOverride() throws Exception {
|
public void testInternalOverride() throws Exception {
|
||||||
|
|||||||
+6
@@ -35223,6 +35223,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi
|
|||||||
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClassJVM.kt");
|
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClassJVM.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("extensionPropertiesOverloads.kt")
|
||||||
|
public void testExtensionPropertiesOverloads() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/multiplatform/k2/extensionPropertiesOverloads.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("internalOverride.kt")
|
@TestMetadata("internalOverride.kt")
|
||||||
public void testInternalOverride() throws Exception {
|
public void testInternalOverride() throws Exception {
|
||||||
|
|||||||
+6
@@ -34804,6 +34804,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
|
|||||||
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClassJVM.kt");
|
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClassJVM.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("extensionPropertiesOverloads.kt")
|
||||||
|
public void testExtensionPropertiesOverloads() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/multiplatform/k2/extensionPropertiesOverloads.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("internalOverride.kt")
|
@TestMetadata("internalOverride.kt")
|
||||||
public void testInternalOverride() throws Exception {
|
public void testInternalOverride() throws Exception {
|
||||||
|
|||||||
+6
@@ -34804,6 +34804,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated
|
|||||||
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClassJVM.kt");
|
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClassJVM.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("extensionPropertiesOverloads.kt")
|
||||||
|
public void testExtensionPropertiesOverloads() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/multiplatform/k2/extensionPropertiesOverloads.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("internalOverride.kt")
|
@TestMetadata("internalOverride.kt")
|
||||||
public void testInternalOverride() throws Exception {
|
public void testInternalOverride() throws Exception {
|
||||||
|
|||||||
+6
@@ -34804,6 +34804,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
|
|||||||
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClassJVM.kt");
|
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClassJVM.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("extensionPropertiesOverloads.kt")
|
||||||
|
public void testExtensionPropertiesOverloads() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/multiplatform/k2/extensionPropertiesOverloads.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("internalOverride.kt")
|
@TestMetadata("internalOverride.kt")
|
||||||
public void testInternalOverride() throws Exception {
|
public void testInternalOverride() throws Exception {
|
||||||
|
|||||||
+5
-1
@@ -271,7 +271,11 @@ internal abstract class IrExpectActualMatchingContext(
|
|||||||
get() = (asIr().parent as? IrClass)?.defaultType
|
get() = (asIr().parent as? IrClass)?.defaultType
|
||||||
|
|
||||||
override val CallableSymbolMarker.extensionReceiverType: IrType?
|
override val CallableSymbolMarker.extensionReceiverType: IrType?
|
||||||
get() = safeAsIr<IrFunction>()?.extensionReceiverParameter?.type
|
get() = when (this) {
|
||||||
|
is IrFunctionSymbol -> owner.extensionReceiverParameter?.type
|
||||||
|
is IrPropertySymbol -> owner.getter?.extensionReceiverParameter?.type
|
||||||
|
else -> null
|
||||||
|
}
|
||||||
|
|
||||||
override val CallableSymbolMarker.extensionReceiverTypeRef: TypeRefMarker?
|
override val CallableSymbolMarker.extensionReceiverTypeRef: TypeRefMarker?
|
||||||
get() = extensionReceiverType
|
get() = extensionReceiverType
|
||||||
|
|||||||
+1
-4
@@ -2,9 +2,6 @@
|
|||||||
// IGNORE_NATIVE_K1: mode=ONE_STAGE_MULTI_MODULE
|
// IGNORE_NATIVE_K1: mode=ONE_STAGE_MULTI_MODULE
|
||||||
// !LANGUAGE: +MultiPlatformProjects
|
// !LANGUAGE: +MultiPlatformProjects
|
||||||
|
|
||||||
// Ignore until KT-62926 is fixed
|
|
||||||
// IGNORE_BACKEND_K2: ANY
|
|
||||||
|
|
||||||
// MODULE: common
|
// MODULE: common
|
||||||
// TARGET_PLATFORM: Common
|
// TARGET_PLATFORM: Common
|
||||||
// FILE: commonMain.kt
|
// FILE: commonMain.kt
|
||||||
@@ -48,4 +45,4 @@ actual var String.l: String
|
|||||||
|
|
||||||
actual typealias S = String
|
actual typealias S = String
|
||||||
|
|
||||||
fun box() = test("O") + k()
|
fun box() = test("O") + k()
|
||||||
|
|||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
// LANGUAGE: +MultiPlatformProjects
|
||||||
|
// IGNORE_BACKEND_K1: JVM, JVM_IR, JS, JS_IR, JS_IR_ES6, WASM
|
||||||
|
// IGNORE_NATIVE_K1: mode=ONE_STAGE_MULTI_MODULE
|
||||||
|
// ISSUE: KT-62926
|
||||||
|
|
||||||
|
// MODULE: common
|
||||||
|
// FILE: common.kt
|
||||||
|
fun commonBox(): String {
|
||||||
|
return "".k + 1.k
|
||||||
|
}
|
||||||
|
|
||||||
|
expect val Int.k: String
|
||||||
|
expect val String.k: String
|
||||||
|
|
||||||
|
// MODULE: platform()()(common)
|
||||||
|
// FILE: platform.kt
|
||||||
|
actual val Int.k: String get() = "K"
|
||||||
|
actual val String.k: String get() = "O"
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
return commonBox()
|
||||||
|
}
|
||||||
+6
@@ -33034,6 +33034,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClassJVM.kt");
|
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClassJVM.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("extensionPropertiesOverloads.kt")
|
||||||
|
public void testExtensionPropertiesOverloads() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/multiplatform/k2/extensionPropertiesOverloads.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("internalOverride.kt")
|
@TestMetadata("internalOverride.kt")
|
||||||
public void testInternalOverride() throws Exception {
|
public void testInternalOverride() throws Exception {
|
||||||
|
|||||||
+6
@@ -34804,6 +34804,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClassJVM.kt");
|
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClassJVM.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("extensionPropertiesOverloads.kt")
|
||||||
|
public void testExtensionPropertiesOverloads() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/multiplatform/k2/extensionPropertiesOverloads.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("internalOverride.kt")
|
@TestMetadata("internalOverride.kt")
|
||||||
public void testInternalOverride() throws Exception {
|
public void testInternalOverride() throws Exception {
|
||||||
|
|||||||
+6
@@ -34804,6 +34804,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
|
|||||||
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClassJVM.kt");
|
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClassJVM.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("extensionPropertiesOverloads.kt")
|
||||||
|
public void testExtensionPropertiesOverloads() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/multiplatform/k2/extensionPropertiesOverloads.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("internalOverride.kt")
|
@TestMetadata("internalOverride.kt")
|
||||||
public void testInternalOverride() throws Exception {
|
public void testInternalOverride() throws Exception {
|
||||||
|
|||||||
+5
@@ -29649,6 +29649,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTest("compiler/testData/codegen/box/multiplatform/k2/actualInnerClassesFirMemberMapping.kt");
|
runTest("compiler/testData/codegen/box/multiplatform/k2/actualInnerClassesFirMemberMapping.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("extensionPropertiesOverloads.kt")
|
||||||
|
public void ignoreExtensionPropertiesOverloads() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/multiplatform/k2/extensionPropertiesOverloads.kt");
|
||||||
|
}
|
||||||
|
|
||||||
private void runTest(String testDataFilePath) throws Exception {
|
private void runTest(String testDataFilePath) throws Exception {
|
||||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
|
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -24412,6 +24412,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClass.kt");
|
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("extensionPropertiesOverloads.kt")
|
||||||
|
public void testExtensionPropertiesOverloads() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/multiplatform/k2/extensionPropertiesOverloads.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("internalOverride.kt")
|
@TestMetadata("internalOverride.kt")
|
||||||
public void testInternalOverride() throws Exception {
|
public void testInternalOverride() throws Exception {
|
||||||
|
|||||||
Generated
+6
@@ -24412,6 +24412,12 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT
|
|||||||
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClass.kt");
|
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("extensionPropertiesOverloads.kt")
|
||||||
|
public void testExtensionPropertiesOverloads() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/multiplatform/k2/extensionPropertiesOverloads.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("internalOverride.kt")
|
@TestMetadata("internalOverride.kt")
|
||||||
public void testInternalOverride() throws Exception {
|
public void testInternalOverride() throws Exception {
|
||||||
|
|||||||
+6
@@ -24412,6 +24412,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClass.kt");
|
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("extensionPropertiesOverloads.kt")
|
||||||
|
public void testExtensionPropertiesOverloads() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/multiplatform/k2/extensionPropertiesOverloads.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("internalOverride.kt")
|
@TestMetadata("internalOverride.kt")
|
||||||
public void testInternalOverride() throws Exception {
|
public void testInternalOverride() throws Exception {
|
||||||
|
|||||||
+6
@@ -24412,6 +24412,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes
|
|||||||
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClass.kt");
|
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("extensionPropertiesOverloads.kt")
|
||||||
|
public void testExtensionPropertiesOverloads() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/multiplatform/k2/extensionPropertiesOverloads.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("internalOverride.kt")
|
@TestMetadata("internalOverride.kt")
|
||||||
public void testInternalOverride() throws Exception {
|
public void testInternalOverride() throws Exception {
|
||||||
|
|||||||
+6
@@ -27666,6 +27666,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
|
|||||||
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClass.kt");
|
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("extensionPropertiesOverloads.kt")
|
||||||
|
public void testExtensionPropertiesOverloads() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/multiplatform/k2/extensionPropertiesOverloads.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("internalOverride.kt")
|
@TestMetadata("internalOverride.kt")
|
||||||
public void testInternalOverride() throws Exception {
|
public void testInternalOverride() throws Exception {
|
||||||
|
|||||||
+6
@@ -28296,6 +28296,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
|
|||||||
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClass.kt");
|
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("extensionPropertiesOverloads.kt")
|
||||||
|
public void testExtensionPropertiesOverloads() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/multiplatform/k2/extensionPropertiesOverloads.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("internalOverride.kt")
|
@TestMetadata("internalOverride.kt")
|
||||||
public void testInternalOverride() throws Exception {
|
public void testInternalOverride() throws Exception {
|
||||||
|
|||||||
+6
@@ -27036,6 +27036,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
|
|||||||
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClass.kt");
|
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("extensionPropertiesOverloads.kt")
|
||||||
|
public void testExtensionPropertiesOverloads() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/multiplatform/k2/extensionPropertiesOverloads.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("internalOverride.kt")
|
@TestMetadata("internalOverride.kt")
|
||||||
public void testInternalOverride() throws Exception {
|
public void testInternalOverride() throws Exception {
|
||||||
|
|||||||
+6
@@ -27667,6 +27667,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
|
|||||||
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClass.kt");
|
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("extensionPropertiesOverloads.kt")
|
||||||
|
public void testExtensionPropertiesOverloads() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/multiplatform/k2/extensionPropertiesOverloads.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("internalOverride.kt")
|
@TestMetadata("internalOverride.kt")
|
||||||
public void testInternalOverride() throws Exception {
|
public void testInternalOverride() throws Exception {
|
||||||
|
|||||||
Generated
+6
@@ -24382,6 +24382,12 @@ public class FirWasmCodegenBoxTestGenerated extends AbstractFirWasmCodegenBoxTes
|
|||||||
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClass.kt");
|
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("extensionPropertiesOverloads.kt")
|
||||||
|
public void testExtensionPropertiesOverloads() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/multiplatform/k2/extensionPropertiesOverloads.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("internalOverride.kt")
|
@TestMetadata("internalOverride.kt")
|
||||||
public void testInternalOverride() throws Exception {
|
public void testInternalOverride() throws Exception {
|
||||||
|
|||||||
Generated
+6
@@ -24382,6 +24382,12 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest
|
|||||||
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClass.kt");
|
runTest("compiler/testData/codegen/box/multiplatform/k2/expectValInInlineClass.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("extensionPropertiesOverloads.kt")
|
||||||
|
public void testExtensionPropertiesOverloads() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/multiplatform/k2/extensionPropertiesOverloads.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("internalOverride.kt")
|
@TestMetadata("internalOverride.kt")
|
||||||
public void testInternalOverride() throws Exception {
|
public void testInternalOverride() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user