JVM_IR KT-50171 add missing parent to temporary vals for proxy fun
This commit is contained in:
+6
@@ -41231,6 +41231,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/sam/kt49226.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt50171.kt")
|
||||
public void testKt50171() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/sam/kt50171.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nonInlinedSamWrapper.kt")
|
||||
public void testNonInlinedSamWrapper() throws Exception {
|
||||
|
||||
+1
@@ -361,6 +361,7 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext)
|
||||
isVar = false, isConst = false, isLateinit = false
|
||||
)
|
||||
tmpVal.initializer = initializer
|
||||
tmpVal.parent = proxyFun.parent
|
||||
temporaryVals.add(tmpVal)
|
||||
return IrGetValueImpl(startOffset, endOffset, tmpVal.symbol)
|
||||
}
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
|
||||
// FULL_JDK
|
||||
// SKIP_JDK6
|
||||
|
||||
import java.util.function.DoubleConsumer
|
||||
|
||||
var value: Double = 3.14
|
||||
|
||||
fun f() = {
|
||||
g(::value::set)
|
||||
}
|
||||
|
||||
fun g(consumer: DoubleConsumer) {
|
||||
consumer.accept(42.0)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
f()()
|
||||
return if (value == 42.0) "OK" else "Fail"
|
||||
}
|
||||
+6
@@ -40799,6 +40799,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/sam/kt49226.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt50171.kt")
|
||||
public void testKt50171() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/sam/kt50171.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nonInlinedSamWrapper.kt")
|
||||
public void testNonInlinedSamWrapper() throws Exception {
|
||||
|
||||
+6
@@ -41231,6 +41231,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/sam/kt49226.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt50171.kt")
|
||||
public void testKt50171() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/sam/kt50171.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nonInlinedSamWrapper.kt")
|
||||
public void testNonInlinedSamWrapper() throws Exception {
|
||||
|
||||
+5
@@ -32760,6 +32760,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/sam/kt49226.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt50171.kt")
|
||||
public void testKt50171() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/sam/kt50171.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nonInlinedSamWrapper.kt")
|
||||
public void testNonInlinedSamWrapper() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/sam/nonInlinedSamWrapper.kt");
|
||||
|
||||
Reference in New Issue
Block a user