FIR2IR: add another fallback for simple synthetic property
This commit is contained in:
committed by
teamcity
parent
b50350f6a5
commit
f2c734fc02
+3
-1
@@ -1171,7 +1171,9 @@ class Fir2IrDeclarationStorage(
|
||||
dispatchReceiverIrClass.declarations.find {
|
||||
it is IrSimpleFunction && it.isFakeOverride && it.name == fir.name &&
|
||||
it.overrides(originalSymbol.owner as IrSimpleFunction)
|
||||
}?.symbol as IrFunctionSymbol
|
||||
}?.symbol as? IrFunctionSymbol
|
||||
// Fallback for simple synthetic property
|
||||
?: originalSymbol
|
||||
} else {
|
||||
originalSymbol
|
||||
}
|
||||
|
||||
+6
@@ -16336,6 +16336,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/fir/classCanNotBeCastedToVoid.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ColorValuePanel.kt")
|
||||
public void testColorValuePanel() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/ColorValuePanel.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ConstValAccess.kt")
|
||||
public void testConstValAccess() throws Exception {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND: ANDROID, ANDROID_IR
|
||||
// WITH_RUNTIME
|
||||
// FULL_JDK
|
||||
|
||||
import java.awt.GridLayout
|
||||
import javax.swing.JPanel
|
||||
|
||||
class Some {
|
||||
val baz get() = foo().layout
|
||||
|
||||
companion object {
|
||||
private fun foo() = object : ButtonPanel() {
|
||||
init {
|
||||
layout = GridLayout()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
abstract class ButtonPanel : JPanel()
|
||||
|
||||
fun box() = if (Some().baz is GridLayout) "OK" else "FAIL"
|
||||
+6
@@ -16336,6 +16336,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/fir/classCanNotBeCastedToVoid.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ColorValuePanel.kt")
|
||||
public void testColorValuePanel() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/ColorValuePanel.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ConstValAccess.kt")
|
||||
public void testConstValAccess() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user