Deprecate public access to @JvmField/const fields in private companions
#KT-25009
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
@kotlin.Metadata
|
||||
final class TestClass$Companion {
|
||||
// source: 'privateCompanionFields.kt'
|
||||
private method <init>(): void
|
||||
public synthetic method <init>(p0: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
private final inner class TestClass$Companion
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class TestClass {
|
||||
// source: 'privateCompanionFields.kt'
|
||||
private final static @org.jetbrains.annotations.NotNull field Companion: TestClass$Companion
|
||||
public deprecated static @java.lang.Deprecated @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull field test2: java.lang.String
|
||||
public deprecated final static @java.lang.Deprecated @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull field test3: java.lang.String
|
||||
public deprecated static @java.lang.Deprecated @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull field test: java.lang.String
|
||||
public deprecated final static @java.lang.Deprecated field testConst: int
|
||||
static method <clinit>(): void
|
||||
public method <init>(): void
|
||||
private final inner class TestClass$Companion
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class TestConst$Companion {
|
||||
// source: 'privateCompanionFields.kt'
|
||||
synthetic final static field $$INSTANCE: TestConst$Companion
|
||||
public final static field testConst: int
|
||||
static method <clinit>(): void
|
||||
private method <init>(): void
|
||||
public final inner class TestConst$Companion
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public interface TestConst {
|
||||
// source: 'privateCompanionFields.kt'
|
||||
public synthetic final static @org.jetbrains.annotations.NotNull field Companion: TestConst$Companion
|
||||
public deprecated final static @java.lang.Deprecated field testConst: int
|
||||
static method <clinit>(): void
|
||||
public final inner class TestConst$Companion
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
final class TestJvmField$Companion {
|
||||
// source: 'privateCompanionFields.kt'
|
||||
synthetic final static field $$INSTANCE: TestJvmField$Companion
|
||||
private method <init>(): void
|
||||
public synthetic method <init>(p0: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
public final inner class TestJvmField$Companion
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public interface TestJvmField {
|
||||
// source: 'privateCompanionFields.kt'
|
||||
public synthetic final static @org.jetbrains.annotations.NotNull field Companion: TestJvmField$Companion
|
||||
public deprecated final static @java.lang.Deprecated @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull field test3: java.lang.String
|
||||
static method <clinit>(): void
|
||||
public final inner class TestJvmField$Companion
|
||||
}
|
||||
Reference in New Issue
Block a user