From 8a098545e680b63cbde57a2ecbb2307cc1cd6ac3 Mon Sep 17 00:00:00 2001 From: Ilmir Usmanov Date: Tue, 11 Aug 2020 14:28:57 +0200 Subject: [PATCH] Minor. Add test --- .../codegen/bytecodeText/coroutines/returnResult.kt | 9 +++++++++ .../kotlin/codegen/BytecodeTextTestGenerated.java | 5 +++++ .../kotlin/codegen/ir/IrBytecodeTextTestGenerated.java | 5 +++++ 3 files changed, 19 insertions(+) create mode 100644 compiler/testData/codegen/bytecodeText/coroutines/returnResult.kt 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");