test for already fixed KT-1726
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
class Foo(
|
||||||
|
var state : Int,
|
||||||
|
val f : (Int) -> Int){
|
||||||
|
|
||||||
|
fun next() : Int {
|
||||||
|
val nextState = f(state)
|
||||||
|
state = nextState
|
||||||
|
return state
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val f = Foo(23, {x -> 2 * x})
|
||||||
|
return if (f.next() == 46) "OK" else "fail"
|
||||||
|
}
|
||||||
@@ -406,4 +406,9 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt1578.kt");
|
blackBoxFile("regressions/kt1578.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testKt1726() throws Exception {
|
||||||
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
|
blackBoxFile("regressions/kt1726.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user