Deprecate public access to @JvmField/const fields in private companions

#KT-25009
This commit is contained in:
Mikhael Bogdanov
2020-10-27 14:42:06 +01:00
parent 8be23df668
commit 57c9afc73a
9 changed files with 132 additions and 7 deletions
@@ -0,0 +1,32 @@
// WITH_RUNTIME
class TestClass {
private companion object {
@JvmField
var test: String = "1"
@JvmField
@java.lang.Deprecated
var test2: String = "2"
@JvmField
val test3: String = "3"
const val testConst = 1
}
}
interface TestConst {
private companion object {
const val testConst = 1
}
}
interface TestJvmField {
private companion object {
@JvmField
val test3: String = "3"
}
}