From 0f9a21d42988a476e80e17b0bf9472da5475d796 Mon Sep 17 00:00:00 2001 From: Ilmir Usmanov Date: Tue, 7 Nov 2017 12:09:50 +0300 Subject: [PATCH] Add regression test for KT-17640 --- .../codegen/bytecodeListing/suspendReifiedFun.kt | 9 +++++++++ .../codegen/bytecodeListing/suspendReifiedFun.txt | 11 +++++++++++ .../kotlin/codegen/BytecodeListingTestGenerated.java | 6 ++++++ 3 files changed, 26 insertions(+) create mode 100644 compiler/testData/codegen/bytecodeListing/suspendReifiedFun.kt create mode 100644 compiler/testData/codegen/bytecodeListing/suspendReifiedFun.txt diff --git a/compiler/testData/codegen/bytecodeListing/suspendReifiedFun.kt b/compiler/testData/codegen/bytecodeListing/suspendReifiedFun.kt new file mode 100644 index 00000000000..e5e5b5974af --- /dev/null +++ b/compiler/testData/codegen/bytecodeListing/suspendReifiedFun.kt @@ -0,0 +1,9 @@ +// WITH_RUNTIME + +open class AbstractStuff() { + inline suspend fun hello(value: T): T = println("Hello, ${T::class}").let { value } +} + +class Stuff: AbstractStuff() { + suspend fun foo() = hello(40) +} diff --git a/compiler/testData/codegen/bytecodeListing/suspendReifiedFun.txt b/compiler/testData/codegen/bytecodeListing/suspendReifiedFun.txt new file mode 100644 index 00000000000..7c0b32cfcee --- /dev/null +++ b/compiler/testData/codegen/bytecodeListing/suspendReifiedFun.txt @@ -0,0 +1,11 @@ +@kotlin.Metadata +public class AbstractStuff { + public method (): void + private final method hello(p0: java.lang.Object, p1: kotlin.coroutines.experimental.Continuation): java.lang.Object +} + +@kotlin.Metadata +public final class Stuff { + public method (): void + public final @org.jetbrains.annotations.Nullable method foo(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.experimental.Continuation): java.lang.Object +} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java index a40afcb4169..3adebec2f1a 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java @@ -150,6 +150,12 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest { doTest(fileName); } + @TestMetadata("suspendReifiedFun.kt") + public void testSuspendReifiedFun() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeListing/suspendReifiedFun.kt"); + doTest(fileName); + } + @TestMetadata("compiler/testData/codegen/bytecodeListing/annotations") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class)