From 981909545130c8aa334da3266aad721efd02b30f Mon Sep 17 00:00:00 2001 From: Alex Tkachman Date: Sat, 4 Aug 2012 22:58:33 +0300 Subject: [PATCH] KT-1739: test for obsolete issue --- compiler/testData/codegen/regressions/kt1739.kt | 11 +++++++++++ .../org/jetbrains/jet/codegen/FunctionGenTest.java | 4 ++++ 2 files changed, 15 insertions(+) create mode 100644 compiler/testData/codegen/regressions/kt1739.kt diff --git a/compiler/testData/codegen/regressions/kt1739.kt b/compiler/testData/codegen/regressions/kt1739.kt new file mode 100644 index 00000000000..832bb197224 --- /dev/null +++ b/compiler/testData/codegen/regressions/kt1739.kt @@ -0,0 +1,11 @@ +public class RunnableFunctionWrapper(val f : () -> Unit) : Runnable { + public override fun run() { + f() + } +} + +fun box() : String { + var res = "" + RunnableFunctionWrapper({ res = "OK" }).run() + return res +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/codegen/FunctionGenTest.java b/compiler/tests/org/jetbrains/jet/codegen/FunctionGenTest.java index d912113456b..8316a2a9eea 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/FunctionGenTest.java +++ b/compiler/tests/org/jetbrains/jet/codegen/FunctionGenTest.java @@ -129,6 +129,10 @@ public class FunctionGenTest extends CodegenTestCase { blackBoxFile("regressions/kt2280.kt"); } + public void testKt1739() { + blackBoxFile("regressions/kt1739.kt"); + } + public static class WithJavaFunctionGenTest extends CodegenTestCase { private void blackBoxFileWithJava(@NotNull String ktFile) throws Exception { File javaClassesTempDirectory = new File(FileUtil.getTempDirectory(), "java-classes");