Don't generate accessors for @JvmField properties in primary constructor

This commit is contained in:
Michael Bogdanov
2015-11-28 14:17:16 +03:00
parent de37cb8f40
commit 1bf521c645
9 changed files with 80 additions and 21 deletions
@@ -0,0 +1,6 @@
public class Test {
public static String invokeMethodWithPublicField() {
C c = new C("OK");
return c.foo;
}
}
@@ -0,0 +1,7 @@
class C(@JvmField val foo: String) {
}
fun box(): String {
return Test.invokeMethodWithPublicField()
}
+9
View File
@@ -0,0 +1,9 @@
class C(@JvmField var foo: String) {
@JvmField var bar: String = "123"
}
// 0 getFoo
// 0 setFoo
// 0 getBar
// 0 setBar
@@ -0,0 +1,5 @@
open class A(@JvmField public val publicField: String = "1",
@JvmField internal val internalField: String = "2",
@JvmField protected val protectedfield: String = "3")
open class B : A()
@@ -0,0 +1,9 @@
open class C : B() {
fun test(): String {
return super.publicField + super.internalField + super.protectedfield
}
}
fun main(args: Array<String>) {
C().test()
}