Tests for KT-4252: Error generating primary constructor with kind OwnerKind
#KT-4252 Obsolete
This commit is contained in:
@@ -0,0 +1,23 @@
|
|||||||
|
class CallbackBlock {}
|
||||||
|
|
||||||
|
public class Foo
|
||||||
|
{
|
||||||
|
class object {
|
||||||
|
private var bar = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
++bar
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getBar(): Int = bar
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box() : String {
|
||||||
|
|
||||||
|
val foo = Foo()
|
||||||
|
|
||||||
|
if (foo.getBar() != 1) return "Fail";
|
||||||
|
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
class Foo() {
|
||||||
|
class object {
|
||||||
|
val bar = "OK";
|
||||||
|
var boo = "FAIL";
|
||||||
|
}
|
||||||
|
|
||||||
|
val a = bar
|
||||||
|
var b = Foo.bar
|
||||||
|
val c: String
|
||||||
|
var d: String
|
||||||
|
|
||||||
|
{
|
||||||
|
c = bar
|
||||||
|
d = Foo.bar
|
||||||
|
boo = "O"
|
||||||
|
Foo.boo += "K"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val foo = Foo()
|
||||||
|
|
||||||
|
if (foo.a != "OK") return "foo.a != OK"
|
||||||
|
if (foo.b != "OK") return "foo.b != OK"
|
||||||
|
if (foo.c != "OK") return "foo.c != OK"
|
||||||
|
if (foo.d != "OK") return "foo.d != OK"
|
||||||
|
if (Foo.boo != "OK") return "Foo.boo != OK"
|
||||||
|
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
@@ -3980,6 +3980,16 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
doTest("compiler/testData/codegen/box/properties/kt4140.kt");
|
doTest("compiler/testData/codegen/box/properties/kt4140.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt4252.kt")
|
||||||
|
public void testKt4252() throws Exception {
|
||||||
|
doTest("compiler/testData/codegen/box/properties/kt4252.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt4252_2.kt")
|
||||||
|
public void testKt4252_2() throws Exception {
|
||||||
|
doTest("compiler/testData/codegen/box/properties/kt4252_2.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt613.kt")
|
@TestMetadata("kt613.kt")
|
||||||
public void testKt613() throws Exception {
|
public void testKt613() throws Exception {
|
||||||
doTest("compiler/testData/codegen/box/properties/kt613.kt");
|
doTest("compiler/testData/codegen/box/properties/kt613.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user