KT-2280 Recursive function declared in function results in VerifyError

#KT-2280 Fixed

A closure's constructor should not take an instance of itself as an
argument, because it would require caller to pass yet uninitialized
value. Instead it should initialize a corresponding field with 'this'
This commit is contained in:
Alexander Udalov
2012-07-31 19:05:38 +04:00
parent b883bf6ef5
commit dcd5cad427
5 changed files with 44 additions and 2 deletions
@@ -66,4 +66,8 @@ public class ClosuresGenTest extends CodegenTestCase {
public void testKt2151() {
blackBoxFile("regressions/kt2151.kt");
}
public void testRecursiveClosure() {
blackBoxFile("classes/recursiveClosure.kt");
}
}
@@ -125,6 +125,10 @@ public class FunctionGenTest extends CodegenTestCase {
blackBoxFile("regressions/kt2481.kt");
}
public void testKt2280() {
blackBoxFile("regressions/kt2280.kt");
}
public static class WithJavaFunctionGenTest extends CodegenTestCase {
private void blackBoxFileWithJava(@NotNull String ktFile) throws Exception {
File javaClassesTempDirectory = new File(FileUtil.getTempDirectory(), "java-classes");