diff --git a/compiler/testData/codegen/bytecodeText/coroutines/returnResult.kt b/compiler/testData/codegen/bytecodeText/coroutines/returnResult.kt new file mode 100644 index 00000000000..5b803c38449 --- /dev/null +++ b/compiler/testData/codegen/bytecodeText/coroutines/returnResult.kt @@ -0,0 +1,9 @@ +@Suppress("RESULT_CLASS_IN_RETURN_TYPE") +suspend fun signInFlowStepFirst(): Result = Result.success(Unit) + +inline class OurAny(val a: Any) + +suspend fun returnsUnboxed(): OurAny = OurAny("OK") + +// 1 INVOKESTATIC kotlin/Result.box-impl +// 0 INVOKESTATIC kotlin/OurAny.box-impl \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java index 17bf34e891d..9442d1b5578 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java @@ -1421,6 +1421,11 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest { runTest("compiler/testData/codegen/bytecodeText/coroutines/nonLocalReturn.kt"); } + @TestMetadata("returnResult.kt") + public void testReturnResult() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/coroutines/returnResult.kt"); + } + @TestMetadata("returnUnitInLambda.kt") public void testReturnUnitInLambda_1_2() throws Exception { runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/returnUnitInLambda.kt", "kotlin.coroutines.experimental"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java index 0e40e836213..3e643575ecc 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java @@ -1431,6 +1431,11 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest { runTest("compiler/testData/codegen/bytecodeText/coroutines/nonLocalReturn.kt"); } + @TestMetadata("returnResult.kt") + public void testReturnResult() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/coroutines/returnResult.kt"); + } + @TestMetadata("returnUnitInLambda.kt") public void testReturnUnitInLambda_1_3() throws Exception { runTestWithPackageReplacement("compiler/testData/codegen/bytecodeText/coroutines/returnUnitInLambda.kt", "kotlin.coroutines");