[FIR2IR] Fix handling private setters in anonymous classes
^KT-65290 Fixed
This commit is contained in:
committed by
Space Team
parent
66d8f471d9
commit
caa6918031
+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");
|
||||
|
||||
Reference in New Issue
Block a user