Don't generate accessors for @JvmField properties in primary constructor
This commit is contained in:
@@ -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()
|
||||
}
|
||||
@@ -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()
|
||||
}
|
||||
Reference in New Issue
Block a user