Codegen tests for lateinit var with private setter

This commit is contained in:
Mikhail Glukhikh
2015-12-17 18:24:56 +03:00
parent 60521e20ff
commit ebda21c68a
3 changed files with 36 additions and 0 deletions
@@ -0,0 +1,12 @@
class My {
lateinit var x: String
private set
fun init() { x = "OK" }
}
fun box(): String {
val my = My()
my.init()
return my.x
}
@@ -0,0 +1,12 @@
class My {
lateinit var x: String
private set
fun init(arg: String, f: (String) -> String) { x = f(arg) }
}
fun box(): String {
val my = My()
my.init("O") { it + "K" }
return my.x
}
@@ -6882,6 +6882,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest(fileName);
}
@TestMetadata("privateSetter.kt")
public void testPrivateSetter() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/privateSetter.kt");
doTest(fileName);
}
@TestMetadata("privateSetterFromLambda.kt")
public void testPrivateSetterFromLambda() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/privateSetterFromLambda.kt");
doTest(fileName);
}
@TestMetadata("simpleVar.kt")
public void testSimpleVar() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/simpleVar.kt");