[FIR] Add support for JVM_STATIC_ON_NON_PUBLIC_MEMBER diagnostic

This commit is contained in:
Nikolay Lunyak
2021-08-02 13:58:32 +03:00
parent c2e5583780
commit f3d61c199b
11 changed files with 220 additions and 90 deletions
@@ -28,7 +28,7 @@ class A {
interface B {
companion object {
@JvmStatic fun a1() {
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic fun a1()<!> {
}
}
@@ -2,60 +2,60 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE
interface B {
companion object {
@JvmStatic fun a1() {
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic fun a1()<!> {
}
@JvmStatic private fun a2() {
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION, JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic private fun a2()<!> {
}
@JvmStatic protected fun a3() {
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION, JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic protected fun a3()<!> {
}
@JvmStatic internal fun a4() {
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION, JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic internal fun a4()<!> {
}
@JvmStatic external fun a5()
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic external fun a5()<!>
@JvmStatic
var foo = 1
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic
var foo<!> = 1
@JvmStatic
var foo1 = 1
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION, JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic
var foo1<!> = 1
protected set
@JvmStatic
var foo2 = 1
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION, JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic
var foo2<!> = 1
private set
@JvmStatic
private var foo3 = 1
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION, JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic
private var foo3<!> = 1
@JvmStatic
protected var foo4 = 1
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION, JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic
protected var foo4<!> = 1
@JvmStatic
protected var foo5 = 1
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION, JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic
protected var foo5<!> = 1
@JvmStatic
val foo6 = 1
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic
val foo6<!> = 1
val foo7 = 1
@JvmStatic get
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic get<!>
private var foo8 = 1
@JvmStatic <!SETTER_VISIBILITY_INCONSISTENT_WITH_PROPERTY_VISIBILITY!>public<!> set
public var foo9 = 1
@JvmStatic private set
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION, JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic private set<!>
@JvmStatic
val foo10: Int external get
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic
val foo10: Int<!> external get
val foo11: Int @JvmStatic external get
val foo11: Int <!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic external get<!>
}
}
}
@@ -8,15 +8,15 @@ interface B {
}
@JvmStatic private fun a2() {
<!JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic private fun a2()<!> {
}
@JvmStatic protected fun a3() {
<!JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic protected fun a3()<!> {
}
@JvmStatic internal fun a4() {
<!JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic internal fun a4()<!> {
}
@@ -25,22 +25,22 @@ interface B {
@JvmStatic
var foo = 1
@JvmStatic
var foo1 = 1
<!JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic
var foo1<!> = 1
protected set
@JvmStatic
var foo2 = 1
<!JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic
var foo2<!> = 1
private set
@JvmStatic
private var foo3 = 1
<!JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic
private var foo3<!> = 1
@JvmStatic
protected var foo4 = 1
<!JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic
protected var foo4<!> = 1
@JvmStatic
protected var foo5 = 1
<!JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic
protected var foo5<!> = 1
@JvmStatic
val foo6 = 1
@@ -52,7 +52,7 @@ interface B {
@JvmStatic <!SETTER_VISIBILITY_INCONSISTENT_WITH_PROPERTY_VISIBILITY!>public<!> set
public var foo9 = 1
@JvmStatic private set
<!JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic private set<!>
@JvmStatic
val foo10: Int external get
@@ -60,4 +60,4 @@ interface B {
val foo11: Int @JvmStatic external get
}
}
}
@@ -7,15 +7,15 @@ interface B {
}
@JvmStatic private fun a2() {
<!JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic private fun a2()<!> {
}
@JvmStatic protected fun a3() {
<!JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic protected fun a3()<!> {
}
@JvmStatic internal fun a4() {
<!JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic internal fun a4()<!> {
}
@@ -24,22 +24,22 @@ interface B {
@JvmStatic
var foo = 1
@JvmStatic
var foo1 = 1
<!JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic
var foo1<!> = 1
protected set
@JvmStatic
var foo2 = 1
<!JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic
var foo2<!> = 1
private set
@JvmStatic
private var foo3 = 1
<!JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic
private var foo3<!> = 1
@JvmStatic
protected var foo4 = 1
<!JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic
protected var foo4<!> = 1
@JvmStatic
protected var foo5 = 1
<!JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic
protected var foo5<!> = 1
@JvmStatic
val foo6 = 1
@@ -51,7 +51,7 @@ interface B {
@JvmStatic <!SETTER_VISIBILITY_INCONSISTENT_WITH_PROPERTY_VISIBILITY!>public<!> set
public var foo9 = 1
@JvmStatic private set
<!JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic private set<!>
@JvmStatic
val foo10: Int external get
@@ -59,4 +59,4 @@ interface B {
val foo11: Int @JvmStatic external get
}
}
}