Private visibility for non-const, non-jvmField class companion property backing field
This commit is contained in:
@@ -3,8 +3,8 @@ class Test {
|
||||
return A.foo;
|
||||
}
|
||||
|
||||
public static String bar() {
|
||||
return A.bar;
|
||||
public static String constBar() {
|
||||
return A.constBar;
|
||||
}
|
||||
|
||||
public static String getBar() {
|
||||
|
||||
+4
-2
@@ -3,7 +3,9 @@ import kotlin.jvm.JvmStatic
|
||||
enum class A {
|
||||
;
|
||||
companion object {
|
||||
val foo: String = "OK"
|
||||
@JvmField val foo: String = "OK"
|
||||
|
||||
const val constBar: String = "OK"
|
||||
|
||||
@JvmStatic val bar: String = "OK"
|
||||
|
||||
@@ -13,7 +15,7 @@ enum class A {
|
||||
|
||||
fun box(): String {
|
||||
if (Test.foo() != "OK") return "Fail foo"
|
||||
if (Test.bar() != "OK") return "Fail bar"
|
||||
if (Test.constBar() != "OK") return "Fail bar"
|
||||
if (Test.getBar() != "OK") return "Fail getBar"
|
||||
if (Test.baz() != "OK") return "Fail baz"
|
||||
return "OK"
|
||||
|
||||
Vendored
+2
-2
@@ -1,7 +1,7 @@
|
||||
class KotlinClass {
|
||||
companion object {
|
||||
val FOO_INT: Int = 10
|
||||
val FOO_STRING: String = "OK"
|
||||
const val FOO_INT: Int = 10
|
||||
@JvmField val FOO_STRING: String = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+6
@@ -5,12 +5,18 @@ class Test {
|
||||
s = Klass.NAME;
|
||||
if (!s.equals("Klass")) throw new AssertionError("Fail class: " + s);
|
||||
|
||||
s = Klass.JVM_NAME;
|
||||
if (!s.equals("JvmKlass")) throw new AssertionError("Fail jvm class: " + s);
|
||||
|
||||
s = Trait.NAME;
|
||||
if (!s.equals("Trait")) throw new AssertionError("Fail interface: " + s);
|
||||
|
||||
s = Enoom.NAME;
|
||||
if (!s.equals("Enum")) throw new AssertionError("Fail enum: " + s);
|
||||
|
||||
s = Enoom.JVM_NAME;
|
||||
if (!s.equals("JvmEnum")) throw new AssertionError("Fail jvm enum: " + s);
|
||||
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+3
-1
@@ -1,6 +1,7 @@
|
||||
class Klass {
|
||||
companion object {
|
||||
val NAME = "Klass"
|
||||
const val NAME = "Klass"
|
||||
@JvmField val JVM_NAME = "JvmKlass"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +15,7 @@ enum class Enoom {
|
||||
;
|
||||
companion object {
|
||||
const val NAME = "Enum"
|
||||
@JvmField val JVM_NAME = "JvmEnum"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user