Switch @JvmStatic diagnostic test to LanguageFeature usage
This commit is contained in:
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// !LANGUAGE: -JvmStaticInInterface
|
||||||
class A(<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic val z: Int<!>) {
|
class A(<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic val z: Int<!>) {
|
||||||
|
|
||||||
}
|
}
|
||||||
Vendored
+4
@@ -0,0 +1,4 @@
|
|||||||
|
// !LANGUAGE: +JvmStaticInInterface
|
||||||
|
class A(<!JVM_STATIC_NOT_IN_OBJECT_OR_COMPANION!>@JvmStatic val z: Int<!>) {
|
||||||
|
|
||||||
|
}
|
||||||
Vendored
+9
@@ -0,0 +1,9 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public final class A {
|
||||||
|
public constructor A(/*0*/ z: kotlin.Int)
|
||||||
|
@kotlin.jvm.JvmStatic public final val z: kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
}
|
||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// !LANGUAGE: -JvmStaticInInterface
|
||||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||||
class A {
|
class A {
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
Vendored
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// !LANGUAGE: -JvmStaticInInterface
|
||||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||||
interface B {
|
interface B {
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// !LANGUAGE: -JvmStaticInInterface
|
||||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic fun a()<!>{
|
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic fun a()<!>{
|
||||||
|
|||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
// !LANGUAGE: +JvmStaticInInterface
|
||||||
|
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
<!JVM_STATIC_NOT_IN_OBJECT_OR_COMPANION!>@JvmStatic fun a()<!>{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// !LANGUAGE: -JvmStaticInInterface
|
||||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||||
open class B {
|
open class B {
|
||||||
public open val base1 : Int = 1
|
public open val base1 : Int = 1
|
||||||
|
|||||||
+45
@@ -0,0 +1,45 @@
|
|||||||
|
// !LANGUAGE: +JvmStaticInInterface
|
||||||
|
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||||
|
open class B {
|
||||||
|
public open val base1 : Int = 1
|
||||||
|
public open val base2 : Int = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
class A {
|
||||||
|
companion object : B() {
|
||||||
|
var p1:Int = 1
|
||||||
|
@JvmStatic set(<!UNUSED_PARAMETER!>p<!>: Int) {
|
||||||
|
p1 = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
@JvmStatic val z = 1;
|
||||||
|
|
||||||
|
@JvmStatic override val base1: Int = 0
|
||||||
|
|
||||||
|
override val base2: Int = 0
|
||||||
|
@JvmStatic get
|
||||||
|
}
|
||||||
|
|
||||||
|
object A : B() {
|
||||||
|
var p:Int = 1
|
||||||
|
@JvmStatic set(<!UNUSED_PARAMETER!>p1<!>: Int) {
|
||||||
|
p = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
@JvmStatic val z = 1;
|
||||||
|
|
||||||
|
<!OVERRIDE_CANNOT_BE_STATIC!>@JvmStatic override val base1: Int<!> = 0
|
||||||
|
|
||||||
|
@JvmStatic <!NON_FINAL_MEMBER_IN_OBJECT!>open<!> fun f() {}
|
||||||
|
|
||||||
|
override val base2: Int = 0
|
||||||
|
<!OVERRIDE_CANNOT_BE_STATIC!>@JvmStatic get<!>
|
||||||
|
}
|
||||||
|
|
||||||
|
var p:Int = 1
|
||||||
|
<!JVM_STATIC_NOT_IN_OBJECT_OR_COMPANION!>@JvmStatic set(<!UNUSED_PARAMETER!>p1<!>: Int)<!> {
|
||||||
|
p = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
<!JVM_STATIC_NOT_IN_OBJECT_OR_COMPANION!>@JvmStatic val z2<!> = 1;
|
||||||
|
}
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public final class A {
|
||||||
|
public constructor A()
|
||||||
|
public final var p: kotlin.Int
|
||||||
|
@kotlin.jvm.JvmStatic public final val z2: kotlin.Int = 1
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
|
||||||
|
public object A : B {
|
||||||
|
private constructor A()
|
||||||
|
@kotlin.jvm.JvmStatic public open override /*1*/ val base1: kotlin.Int = 0
|
||||||
|
public open override /*1*/ val base2: kotlin.Int = 0
|
||||||
|
public final var p: kotlin.Int
|
||||||
|
@kotlin.jvm.JvmStatic public final val z: kotlin.Int = 1
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
@kotlin.jvm.JvmStatic public open fun f(): kotlin.Unit
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
}
|
||||||
|
|
||||||
|
public companion object Companion : B {
|
||||||
|
private constructor Companion()
|
||||||
|
@kotlin.jvm.JvmStatic public open override /*1*/ val base1: kotlin.Int = 0
|
||||||
|
public open override /*1*/ val base2: kotlin.Int = 0
|
||||||
|
public final var p1: kotlin.Int
|
||||||
|
@kotlin.jvm.JvmStatic public final val z: kotlin.Int = 1
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public open class B {
|
||||||
|
public constructor B()
|
||||||
|
public open val base1: kotlin.Int = 1
|
||||||
|
public open val base2: kotlin.Int = 1
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
}
|
||||||
+15
@@ -648,6 +648,11 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
|
|||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/constructorProperty.kt");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/constructorProperty.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("constructorProperty_LL13.kt")
|
||||||
|
public void testConstructorProperty_LL13() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/constructorProperty_LL13.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("constructors.kt")
|
@TestMetadata("constructors.kt")
|
||||||
public void testConstructors() throws Exception {
|
public void testConstructors() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/constructors.kt");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/constructors.kt");
|
||||||
@@ -688,10 +693,20 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
|
|||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/localFun.kt");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/localFun.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("localFun_LL13.kt")
|
||||||
|
public void testLocalFun_LL13() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/localFun_LL13.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("property.kt")
|
@TestMetadata("property.kt")
|
||||||
public void testProperty() throws Exception {
|
public void testProperty() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/property.kt");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/property.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("property_LL13.kt")
|
||||||
|
public void testProperty_LL13() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/property_LL13.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/kClass")
|
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/kClass")
|
||||||
|
|||||||
compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java
Generated
+15
@@ -648,6 +648,11 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
|
|||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/constructorProperty.kt");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/constructorProperty.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("constructorProperty_LL13.kt")
|
||||||
|
public void testConstructorProperty_LL13() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/constructorProperty_LL13.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("constructors.kt")
|
@TestMetadata("constructors.kt")
|
||||||
public void testConstructors() throws Exception {
|
public void testConstructors() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/constructors.kt");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/constructors.kt");
|
||||||
@@ -688,10 +693,20 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
|
|||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/localFun.kt");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/localFun.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("localFun_LL13.kt")
|
||||||
|
public void testLocalFun_LL13() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/localFun_LL13.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("property.kt")
|
@TestMetadata("property.kt")
|
||||||
public void testProperty() throws Exception {
|
public void testProperty() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/property.kt");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/property.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("property_LL13.kt")
|
||||||
|
public void testProperty_LL13() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/property_LL13.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/kClass")
|
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/kClass")
|
||||||
|
|||||||
Reference in New Issue
Block a user