diff --git a/compiler/testData/codegen/regressions/kt640.jet b/compiler/testData/codegen/regressions/kt640.jet new file mode 100644 index 00000000000..705fc1f338c --- /dev/null +++ b/compiler/testData/codegen/regressions/kt640.jet @@ -0,0 +1,29 @@ +namespace demo + +public open class Identifier(myName : T?, myHasDollar : Boolean) { + { + $myName = myName + $myHasDollar = myHasDollar + } + + private val myName : T? + private var myHasDollar : Boolean + private var myNullable : Boolean = true + + open public fun getName() : T? { + return myName + } + + class object { + open public fun init(name : T?) : Identifier { + val __ = Identifier(name, false) + return __ + } + } +} + +fun box() : String { + var i3 : Identifier<*>? = Identifier.init("name") + System.out?.println("Hello, " + i3?.getName()) + return "OK" +} diff --git a/compiler/tests/org/jetbrains/jet/codegen/ObjectGenTest.java b/compiler/tests/org/jetbrains/jet/codegen/ObjectGenTest.java index 05c5a66ca93..d8eb251833e 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/ObjectGenTest.java +++ b/compiler/tests/org/jetbrains/jet/codegen/ObjectGenTest.java @@ -25,4 +25,8 @@ public class ObjectGenTest extends CodegenTestCase { public void testKt560() throws Exception { blackBoxFile("regressions/kt560.jet"); } + + public void testKt640() throws Exception { + blackBoxFile("regressions/kt640.jet"); + } } diff --git a/compiler/tests/org/jetbrains/jet/compiler/CompileEnvironmentTest.java b/compiler/tests/org/jetbrains/jet/compiler/CompileEnvironmentTest.java index 41ec6729100..520dee18d48 100644 --- a/compiler/tests/org/jetbrains/jet/compiler/CompileEnvironmentTest.java +++ b/compiler/tests/org/jetbrains/jet/compiler/CompileEnvironmentTest.java @@ -76,14 +76,15 @@ public class CompileEnvironmentTest extends TestCase { } } - private static void delete(File file) { + private static boolean delete(File file) { + boolean success = true; if(file.isDirectory()) { for (File child : file.listFiles()) { - delete(child); + success = success && delete(child); } } - file.delete(); + return file.delete() && success; } public void testSmokeWithCompilerOutput() throws IOException { @@ -101,7 +102,7 @@ public class CompileEnvironmentTest extends TestCase { } } - private List listEntries(JarInputStream is) throws IOException { + private static List listEntries(JarInputStream is) throws IOException { List entries = new ArrayList(); while (true) { final JarEntry jarEntry = is.getNextJarEntry();