JVM_IR: add a transformChildren call to PropertyReferenceLowering
#KT-42354 Fixed
This commit is contained in:
Generated
+5
@@ -2976,6 +2976,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/property/inEnum.kt");
|
runTest("compiler/testData/codegen/box/callableReference/property/inEnum.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inReceiverOfAnother.kt")
|
||||||
|
public void testInReceiverOfAnother() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/property/inReceiverOfAnother.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("invokePropertyReference.kt")
|
@TestMetadata("invokePropertyReference.kt")
|
||||||
public void testInvokePropertyReference() throws Exception {
|
public void testInvokePropertyReference() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/callableReference/property/invokePropertyReference.kt");
|
runTest("compiler/testData/codegen/box/callableReference/property/invokePropertyReference.kt");
|
||||||
|
|||||||
+1
-3
@@ -66,9 +66,6 @@ internal class PropertyReferenceLowering(val context: JvmBackendContext) : Class
|
|||||||
private val IrMemberAccessExpression<*>.field: IrFieldSymbol?
|
private val IrMemberAccessExpression<*>.field: IrFieldSymbol?
|
||||||
get() = (this as? IrPropertyReference)?.field
|
get() = (this as? IrPropertyReference)?.field
|
||||||
|
|
||||||
private val IrSimpleFunction.signature: String
|
|
||||||
get() = context.methodSignatureMapper.mapSignatureSkipGeneric(collectRealOverrides().first()).toString()
|
|
||||||
|
|
||||||
// Plain Java fields do not have a getter, but can be referenced nonetheless. The signature should be the one
|
// Plain Java fields do not have a getter, but can be referenced nonetheless. The signature should be the one
|
||||||
// that a getter would have, if it existed.
|
// that a getter would have, if it existed.
|
||||||
private val IrField.signature: String
|
private val IrField.signature: String
|
||||||
@@ -216,6 +213,7 @@ internal class PropertyReferenceLowering(val context: JvmBackendContext) : Class
|
|||||||
cachedKProperty(expression)
|
cachedKProperty(expression)
|
||||||
|
|
||||||
private fun cachedKProperty(expression: IrCallableReference<*>): IrExpression {
|
private fun cachedKProperty(expression: IrCallableReference<*>): IrExpression {
|
||||||
|
expression.transformChildrenVoid()
|
||||||
if (expression.origin != IrStatementOrigin.PROPERTY_REFERENCE_FOR_DELEGATE)
|
if (expression.origin != IrStatementOrigin.PROPERTY_REFERENCE_FOR_DELEGATE)
|
||||||
return createSpecializedKProperty(expression)
|
return createSpecializedKProperty(expression)
|
||||||
|
|
||||||
|
|||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
var x = "OK"
|
||||||
|
|
||||||
|
class C(init: () -> String) {
|
||||||
|
val value = init()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box() = C(::x)::value.get()
|
||||||
+5
@@ -2996,6 +2996,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/property/inEnum.kt");
|
runTest("compiler/testData/codegen/box/callableReference/property/inEnum.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inReceiverOfAnother.kt")
|
||||||
|
public void testInReceiverOfAnother() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/property/inReceiverOfAnother.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("invokePropertyReference.kt")
|
@TestMetadata("invokePropertyReference.kt")
|
||||||
public void testInvokePropertyReference() throws Exception {
|
public void testInvokePropertyReference() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/callableReference/property/invokePropertyReference.kt");
|
runTest("compiler/testData/codegen/box/callableReference/property/invokePropertyReference.kt");
|
||||||
|
|||||||
+5
@@ -2996,6 +2996,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/property/inEnum.kt");
|
runTest("compiler/testData/codegen/box/callableReference/property/inEnum.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inReceiverOfAnother.kt")
|
||||||
|
public void testInReceiverOfAnother() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/property/inReceiverOfAnother.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("invokePropertyReference.kt")
|
@TestMetadata("invokePropertyReference.kt")
|
||||||
public void testInvokePropertyReference() throws Exception {
|
public void testInvokePropertyReference() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/callableReference/property/invokePropertyReference.kt");
|
runTest("compiler/testData/codegen/box/callableReference/property/invokePropertyReference.kt");
|
||||||
|
|||||||
+5
@@ -2976,6 +2976,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/property/inEnum.kt");
|
runTest("compiler/testData/codegen/box/callableReference/property/inEnum.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inReceiverOfAnother.kt")
|
||||||
|
public void testInReceiverOfAnother() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/property/inReceiverOfAnother.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("invokePropertyReference.kt")
|
@TestMetadata("invokePropertyReference.kt")
|
||||||
public void testInvokePropertyReference() throws Exception {
|
public void testInvokePropertyReference() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/callableReference/property/invokePropertyReference.kt");
|
runTest("compiler/testData/codegen/box/callableReference/property/invokePropertyReference.kt");
|
||||||
|
|||||||
Generated
+5
@@ -2341,6 +2341,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/property/inEnum.kt");
|
runTest("compiler/testData/codegen/box/callableReference/property/inEnum.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inReceiverOfAnother.kt")
|
||||||
|
public void testInReceiverOfAnother() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/property/inReceiverOfAnother.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("invokePropertyReference.kt")
|
@TestMetadata("invokePropertyReference.kt")
|
||||||
public void testInvokePropertyReference() throws Exception {
|
public void testInvokePropertyReference() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/callableReference/property/invokePropertyReference.kt");
|
runTest("compiler/testData/codegen/box/callableReference/property/invokePropertyReference.kt");
|
||||||
|
|||||||
Generated
+5
@@ -2341,6 +2341,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/property/inEnum.kt");
|
runTest("compiler/testData/codegen/box/callableReference/property/inEnum.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inReceiverOfAnother.kt")
|
||||||
|
public void testInReceiverOfAnother() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/property/inReceiverOfAnother.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("invokePropertyReference.kt")
|
@TestMetadata("invokePropertyReference.kt")
|
||||||
public void testInvokePropertyReference() throws Exception {
|
public void testInvokePropertyReference() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/callableReference/property/invokePropertyReference.kt");
|
runTest("compiler/testData/codegen/box/callableReference/property/invokePropertyReference.kt");
|
||||||
|
|||||||
+5
@@ -2341,6 +2341,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/property/inEnum.kt");
|
runTest("compiler/testData/codegen/box/callableReference/property/inEnum.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inReceiverOfAnother.kt")
|
||||||
|
public void testInReceiverOfAnother() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/callableReference/property/inReceiverOfAnother.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("invokePropertyReference.kt")
|
@TestMetadata("invokePropertyReference.kt")
|
||||||
public void testInvokePropertyReference() throws Exception {
|
public void testInvokePropertyReference() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/callableReference/property/invokePropertyReference.kt");
|
runTest("compiler/testData/codegen/box/callableReference/property/invokePropertyReference.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user