Minor: cover negative cases with test +m

Add case without reported diagnostic on public companion.
Only report diagnostic if @JvmStatic annotation has source in code.

KT-25114
This commit is contained in:
Pavel Kirpichenkov
2020-10-15 18:29:29 +03:00
parent 9669ab1468
commit 04a4f9cde6
4 changed files with 83 additions and 6 deletions
@@ -26,4 +26,31 @@ class WithPrivateCompanion {
<!JVM_STATIC_IN_PRIVATE_COMPANION!>@JvmStatic<!>
fun staticFunction() {}
}
}
}
class WithPublicCompanion {
companion object {
@JvmStatic
val staticVal1: Int = 42
val staticVal2: Int
@JvmStatic get() = 42
@get:JvmStatic
val staticVal3: Int = 42
@JvmStatic
var staticVar1: Int = 42
var staticVar2: Int
@JvmStatic get() = 42
@JvmStatic set(value) {}
@get: JvmStatic
@set: JvmStatic
var staticVar3: Int = 42
@JvmStatic
fun staticFunction() {}
}
}