From 860544d299e9d422d538129ff6c361032c8d36ab Mon Sep 17 00:00:00 2001 From: Michael Bogdanov Date: Fri, 10 Oct 2014 17:20:12 +0400 Subject: [PATCH] Obsolete KT-5685: VerifyError: Bad local variable type for class with inline method and optional parameters #KT-5685 Obsolete --- .../codegen/boxInline/defaultValues/kt5685.1.kt | 10 ++++++++++ .../codegen/boxInline/defaultValues/kt5685.2.kt | 9 +++++++++ .../generated/BlackBoxInlineCodegenTestGenerated.java | 6 ++++++ .../CompileKotlinAgainstInlineKotlinTestGenerated.java | 6 ++++++ 4 files changed, 31 insertions(+) create mode 100644 compiler/testData/codegen/boxInline/defaultValues/kt5685.1.kt create mode 100644 compiler/testData/codegen/boxInline/defaultValues/kt5685.2.kt diff --git a/compiler/testData/codegen/boxInline/defaultValues/kt5685.1.kt b/compiler/testData/codegen/boxInline/defaultValues/kt5685.1.kt new file mode 100644 index 00000000000..07b3ab5a4a2 --- /dev/null +++ b/compiler/testData/codegen/boxInline/defaultValues/kt5685.1.kt @@ -0,0 +1,10 @@ +import test.* + +fun box(): String { + var s1 = "" + val s2 = Measurements().measure("K") { + s1 = "O" + } + + return s1 + s2 +} diff --git a/compiler/testData/codegen/boxInline/defaultValues/kt5685.2.kt b/compiler/testData/codegen/boxInline/defaultValues/kt5685.2.kt new file mode 100644 index 00000000000..9337adede03 --- /dev/null +++ b/compiler/testData/codegen/boxInline/defaultValues/kt5685.2.kt @@ -0,0 +1,9 @@ +package test + +class Measurements +{ + inline fun measure(key: String, logEvery: Long = -1, divisor: Int = 1, body: () -> Unit): String { + body() + return key + } +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxInlineCodegenTestGenerated.java index 872434294db..df6777dac07 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxInlineCodegenTestGenerated.java @@ -213,6 +213,12 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxCodegenT doTestMultiFileWithInlineCheck(fileName); } + @TestMetadata("kt5685.1.kt") + public void testKt5685() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/kt5685.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + @TestMetadata("simpleDefaultMethod.1.kt") public void testSimpleDefaultMethod() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/simpleDefaultMethod.1.kt"); diff --git a/compiler/tests/org/jetbrains/jet/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/jet/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java index 78860bbb060..5b27aea6378 100644 --- a/compiler/tests/org/jetbrains/jet/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -213,6 +213,12 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi doBoxTestWithInlineCheck(fileName); } + @TestMetadata("kt5685.1.kt") + public void testKt5685() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/kt5685.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + @TestMetadata("simpleDefaultMethod.1.kt") public void testSimpleDefaultMethod() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/defaultValues/simpleDefaultMethod.1.kt");