[FIR2IR] Fix handling private setters in anonymous classes
^KT-65290 Fixed
This commit is contained in:
committed by
Space Team
parent
66d8f471d9
commit
caa6918031
+6
@@ -19298,6 +19298,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideInAnonymousObject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideOfPrivateSetter.kt")
|
||||
public void testFakeOverrideOfPrivateSetter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideOfPrivateSetter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("function.kt")
|
||||
public void testFunction() throws Exception {
|
||||
|
||||
+6
@@ -19298,6 +19298,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideInAnonymousObject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideOfPrivateSetter.kt")
|
||||
public void testFakeOverrideOfPrivateSetter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideOfPrivateSetter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("function.kt")
|
||||
public void testFunction() throws Exception {
|
||||
|
||||
+1
-1
@@ -620,7 +620,7 @@ class Fir2IrDeclarationStorage(
|
||||
|
||||
val setterSymbol = runIf(property.isVar) {
|
||||
val setterIsVisible = property.setter?.let { setter ->
|
||||
fakeOverrideOwnerLookupTag?.toFirRegularClass(session)?.let { containingClass -> setter.isVisibleInClass(containingClass) }
|
||||
(fakeOverrideOwnerLookupTag?.toSymbol(session) as? FirClassSymbol<*>)?.fir?.let { containingClass -> setter.isVisibleInClass(containingClass) }
|
||||
} ?: true
|
||||
runIf(setterIsVisible) {
|
||||
IrFunctionFakeOverrideSymbol(originalSymbols.setterSymbol!!, containingClassSymbol, idSignature = null)
|
||||
|
||||
+6
@@ -19287,6 +19287,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideInAnonymousObject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideOfPrivateSetter.kt")
|
||||
public void testFakeOverrideOfPrivateSetter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideOfPrivateSetter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("function.kt")
|
||||
public void testFunction() throws Exception {
|
||||
|
||||
+6
@@ -19287,6 +19287,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideInAnonymousObject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideOfPrivateSetter.kt")
|
||||
public void testFakeOverrideOfPrivateSetter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideOfPrivateSetter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("function.kt")
|
||||
public void testFunction() throws Exception {
|
||||
|
||||
+6
@@ -19287,6 +19287,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideInAnonymousObject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideOfPrivateSetter.kt")
|
||||
public void testFakeOverrideOfPrivateSetter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideOfPrivateSetter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("function.kt")
|
||||
public void testFunction() throws Exception {
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
MODULE main
|
||||
CLASS TextRendererActions1.class
|
||||
CLASS METADATA
|
||||
PROPERTY getFontSize()Ljava/lang/String;
|
||||
Property: class.metadata.property.setterValueParameter
|
||||
K1
|
||||
<set-?>: kotlin/String
|
||||
K2
|
||||
value: kotlin/String
|
||||
@@ -0,0 +1,11 @@
|
||||
// JVM_ABI_K1_K2_DIFF: KT-63984
|
||||
|
||||
abstract class TextRendererActions1 {
|
||||
var fontSize: String = "OK"; private set
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
return object : TextRendererActions1() {
|
||||
val glyph = this.fontSize
|
||||
}.glyph
|
||||
}
|
||||
+6
@@ -19287,6 +19287,12 @@ public class JvmAbiConsistencyTestBoxGenerated extends AbstractJvmAbiConsistency
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideInAnonymousObject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideOfPrivateSetter.kt")
|
||||
public void testFakeOverrideOfPrivateSetter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideOfPrivateSetter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("function.kt")
|
||||
public void testFunction() throws Exception {
|
||||
|
||||
+6
@@ -18447,6 +18447,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/diamondFunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideOfPrivateSetter.kt")
|
||||
public void testFakeOverrideOfPrivateSetter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideOfPrivateSetter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("function.kt")
|
||||
public void testFunction() throws Exception {
|
||||
|
||||
+6
@@ -19287,6 +19287,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideInAnonymousObject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideOfPrivateSetter.kt")
|
||||
public void testFakeOverrideOfPrivateSetter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideOfPrivateSetter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("function.kt")
|
||||
public void testFunction() throws Exception {
|
||||
|
||||
+6
@@ -19287,6 +19287,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideInAnonymousObject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideOfPrivateSetter.kt")
|
||||
public void testFakeOverrideOfPrivateSetter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideOfPrivateSetter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("function.kt")
|
||||
public void testFunction() throws Exception {
|
||||
|
||||
+5
@@ -16069,6 +16069,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideInAnonymousObject.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("fakeOverrideOfPrivateSetter.kt")
|
||||
public void testFakeOverrideOfPrivateSetter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideOfPrivateSetter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("function.kt")
|
||||
public void testFunction() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/function.kt");
|
||||
|
||||
+6
@@ -14451,6 +14451,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/diamondFunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideOfPrivateSetter.kt")
|
||||
public void testFakeOverrideOfPrivateSetter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideOfPrivateSetter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("function.kt")
|
||||
public void testFunction() throws Exception {
|
||||
|
||||
Generated
+6
@@ -14451,6 +14451,12 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/diamondFunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideOfPrivateSetter.kt")
|
||||
public void testFakeOverrideOfPrivateSetter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideOfPrivateSetter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("function.kt")
|
||||
public void testFunction() throws Exception {
|
||||
|
||||
+6
@@ -14451,6 +14451,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/diamondFunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideOfPrivateSetter.kt")
|
||||
public void testFakeOverrideOfPrivateSetter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideOfPrivateSetter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("function.kt")
|
||||
public void testFunction() throws Exception {
|
||||
|
||||
+6
@@ -14451,6 +14451,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/diamondFunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideOfPrivateSetter.kt")
|
||||
public void testFakeOverrideOfPrivateSetter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideOfPrivateSetter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("function.kt")
|
||||
public void testFunction() throws Exception {
|
||||
|
||||
+6
@@ -16022,6 +16022,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/diamondFunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideOfPrivateSetter.kt")
|
||||
public void testFakeOverrideOfPrivateSetter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideOfPrivateSetter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("function.kt")
|
||||
public void testFunction() throws Exception {
|
||||
|
||||
+6
@@ -16396,6 +16396,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/diamondFunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideOfPrivateSetter.kt")
|
||||
public void testFakeOverrideOfPrivateSetter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideOfPrivateSetter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("function.kt")
|
||||
public void testFunction() throws Exception {
|
||||
|
||||
+6
@@ -15648,6 +15648,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/diamondFunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideOfPrivateSetter.kt")
|
||||
public void testFakeOverrideOfPrivateSetter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideOfPrivateSetter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("function.kt")
|
||||
public void testFunction() throws Exception {
|
||||
|
||||
+6
@@ -16023,6 +16023,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/diamondFunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideOfPrivateSetter.kt")
|
||||
public void testFakeOverrideOfPrivateSetter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideOfPrivateSetter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("function.kt")
|
||||
public void testFunction() throws Exception {
|
||||
|
||||
Generated
+6
@@ -14427,6 +14427,12 @@ public class FirWasmJsCodegenBoxTestGenerated extends AbstractFirWasmJsCodegenBo
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/diamondFunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideOfPrivateSetter.kt")
|
||||
public void testFakeOverrideOfPrivateSetter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideOfPrivateSetter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("function.kt")
|
||||
public void testFunction() throws Exception {
|
||||
|
||||
Generated
+6
@@ -14427,6 +14427,12 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/diamondFunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("fakeOverrideOfPrivateSetter.kt")
|
||||
public void testFakeOverrideOfPrivateSetter() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fakeOverride/fakeOverrideOfPrivateSetter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("function.kt")
|
||||
public void testFunction() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user