From 2e14454391fc19bacd45fbb6163cc3f30abaa3e4 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 8 Jun 2012 18:40:26 +0200 Subject: [PATCH] test for fixed KT-1439 --- .../testData/codegen/regressions/kt1439.kt | 17 +++++++++++++++ .../jetbrains/jet/codegen/ClassGenTest.java | 21 ++++++++++++------- 2 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 compiler/testData/codegen/regressions/kt1439.kt diff --git a/compiler/testData/codegen/regressions/kt1439.kt b/compiler/testData/codegen/regressions/kt1439.kt new file mode 100644 index 00000000000..f5cd98d49c4 --- /dev/null +++ b/compiler/testData/codegen/regressions/kt1439.kt @@ -0,0 +1,17 @@ +class MyClass(var fnc : () -> String) { + + fun test(): String { + return fnc() + } + +} + +fun printtest() : String { + return "OK" +} + +fun box(): String { + var c = MyClass({ printtest() }) + + return c.test() +} diff --git a/compiler/tests/org/jetbrains/jet/codegen/ClassGenTest.java b/compiler/tests/org/jetbrains/jet/codegen/ClassGenTest.java index 91a3e6b9d96..00ababbba6a 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/ClassGenTest.java +++ b/compiler/tests/org/jetbrains/jet/codegen/ClassGenTest.java @@ -382,42 +382,47 @@ public class ClassGenTest extends CodegenTestCase { blackBoxFile("regressions/kt1759.kt"); } - public void testResolveOrder() throws Exception { + public void testResolveOrder() { createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS); blackBoxFile("classes/resolveOrder.jet"); } - public void testKt1918() throws Exception { + public void testKt1918() { createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS); blackBoxFile("regressions/kt1918.kt"); } - public void testKt1247() throws Exception { + public void testKt1247() { createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS); blackBoxFile("regressions/kt1247.kt"); } - public void testKt1980() throws Exception { + public void testKt1980() { createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS); blackBoxFile("regressions/kt1980.kt"); } - public void testKt1578() throws Exception { + public void testKt1578() { createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS); blackBoxFile("regressions/kt1578.kt"); } - public void testKt1726() throws Exception { + public void testKt1726() { createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS); blackBoxFile("regressions/kt1726.kt"); } - public void testKt1976() throws Exception { + public void testKt1976() { createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS); blackBoxFile("regressions/kt1976.kt"); } - public void testKt1611() throws Exception { + public void testKt1439() { + createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS); + blackBoxFile("regressions/kt1439.kt"); + } + + public void testKt1611() { createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS); blackBoxFile("regressions/kt1611.kt"); }