JS IR: fix origin for callable references with bound reciever

In case of IrFunctionReference with type SuspendFunction (no K!) there
was a misalignment between the base class (Any) and the
origin (LAMBDA..). As a result the SuspendFunctionLowering was
getting confused and produced hanging code.
This commit is contained in:
Anton Bannykh
2020-05-13 19:31:25 +03:00
parent bdca4b45bd
commit 86b5c63891
6 changed files with 22 additions and 6 deletions
@@ -1577,6 +1577,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
}
@TestMetadata("bound.kt")
public void testBound() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/bound.kt");
}
@TestMetadata("crossInline.kt")
public void testCrossInline() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/crossInline.kt");
@@ -1597,6 +1602,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/inlineAdaptedWithVarargs.kt");
}
@TestMetadata("inlineBound.kt")
public void testInlineBound() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/inlineBound.kt");
}
@TestMetadata("inlineSimple.kt")
public void testInlineSimple() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/inlineSimple.kt");
@@ -1577,6 +1577,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
}
@TestMetadata("bound.kt")
public void testBound() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/bound.kt");
}
@TestMetadata("crossInline.kt")
public void testCrossInline() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/crossInline.kt");
@@ -1597,6 +1602,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/inlineAdaptedWithVarargs.kt");
}
@TestMetadata("inlineBound.kt")
public void testInlineBound() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/inlineBound.kt");
}
@TestMetadata("inlineSimple.kt")
public void testInlineSimple() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/inlineSimple.kt");