diff --git a/compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInClass.kt b/compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInClass.kt new file mode 100644 index 00000000000..7613e3e4e85 --- /dev/null +++ b/compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInClass.kt @@ -0,0 +1,20 @@ +// FILE: test.kt +// WITH_RUNTIME +// WITH_COROUTINES +// NO_CHECK_LAMBDA_INLINING +class C { + suspend inline fun test(default: C = this, lambda: suspend () -> String) = lambda() +} + +// FILE: box.kt +import kotlin.coroutines.* +import helpers.* + +var res = "fail" + +fun box() : String { + suspend { + res = C().test { "OK" } + }.startCoroutine(EmptyContinuation) + return res +} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java index 3d95d97ad8b..53d96357a27 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java @@ -3917,6 +3917,11 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt", "kotlin.coroutines"); } + @TestMetadata("defaultValueInClass.kt") + public void testDefaultValueInClass() throws Exception { + runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInClass.kt"); + } + @TestMetadata("defaultValueInlineFromMultiFileFacade.kt") public void testDefaultValueInlineFromMultiFileFacade_1_2() throws Exception { runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInlineFromMultiFileFacade.kt", "kotlin.coroutines.experimental"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java index 917260b524b..57f99e548cf 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -3917,6 +3917,11 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt", "kotlin.coroutines"); } + @TestMetadata("defaultValueInClass.kt") + public void testDefaultValueInClass() throws Exception { + runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInClass.kt"); + } + @TestMetadata("defaultValueInlineFromMultiFileFacade.kt") public void testDefaultValueInlineFromMultiFileFacade_1_2() throws Exception { runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInlineFromMultiFileFacade.kt", "kotlin.coroutines.experimental"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java index 1cdb785dd8d..7885de0e2b9 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java @@ -3807,6 +3807,11 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt", "kotlin.coroutines"); } + @TestMetadata("defaultValueInClass.kt") + public void testDefaultValueInClass() throws Exception { + runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInClass.kt"); + } + @TestMetadata("defaultValueInlineFromMultiFileFacade.kt") public void testDefaultValueInlineFromMultiFileFacade_1_3() throws Exception { runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInlineFromMultiFileFacade.kt", "kotlin.coroutines"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java index c7089756397..01c928aca19 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java @@ -3807,6 +3807,11 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt", "kotlin.coroutines"); } + @TestMetadata("defaultValueInClass.kt") + public void testDefaultValueInClass() throws Exception { + runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInClass.kt"); + } + @TestMetadata("defaultValueInlineFromMultiFileFacade.kt") public void testDefaultValueInlineFromMultiFileFacade_1_3() throws Exception { runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInlineFromMultiFileFacade.kt", "kotlin.coroutines"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrInlineSuspendTestsGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrInlineSuspendTestsGenerated.java index 65ae2605c03..02121995eac 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrInlineSuspendTestsGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrInlineSuspendTestsGenerated.java @@ -167,6 +167,11 @@ public class IrInlineSuspendTestsGenerated extends AbstractIrInlineSuspendTests runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt", "kotlin.coroutines"); } + @TestMetadata("defaultValueInClass.kt") + public void testDefaultValueInClass() throws Exception { + runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInClass.kt"); + } + @TestMetadata("defaultValueInlineFromMultiFileFacade.kt") public void testDefaultValueInlineFromMultiFileFacade_1_3() throws Exception { runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInlineFromMultiFileFacade.kt", "kotlin.coroutines"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineSuspendTestsGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineSuspendTestsGenerated.java index b160d92e5a3..deb833bcd5f 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineSuspendTestsGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineSuspendTestsGenerated.java @@ -167,6 +167,11 @@ public class InlineSuspendTestsGenerated extends AbstractInlineSuspendTests { runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt", "kotlin.coroutines"); } + @TestMetadata("defaultValueInClass.kt") + public void testDefaultValueInClass() throws Exception { + runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInClass.kt"); + } + @TestMetadata("defaultValueInlineFromMultiFileFacade.kt") public void testDefaultValueInlineFromMultiFileFacade_1_3() throws Exception { runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInlineFromMultiFileFacade.kt", "kotlin.coroutines");