Do not report warning about useless annotations for JvmStatic properties
#KT-25745 Fixed
This commit is contained in:
+1
-4
@@ -82,9 +82,6 @@ class JvmAnnotationsTargetNonExistentAccessorChecker : DeclarationChecker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun isSpecialStaticProperty(descriptor: MemberDescriptor): Boolean {
|
private fun isSpecialStaticProperty(descriptor: MemberDescriptor): Boolean {
|
||||||
return descriptor.hasJvmStaticAnnotation() ||
|
return descriptor.hasJvmFieldAnnotation() || (descriptor is VariableDescriptor && descriptor.isConst)
|
||||||
descriptor.hasJvmFieldAnnotation() ||
|
|
||||||
(descriptor is VariableDescriptor && descriptor.isConst)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
compiler/testData/diagnostics/testsWithStdLib/annotations/annotationsTargetingNonExistentAccessor.kt
Vendored
+5
-1
@@ -77,12 +77,16 @@ class Statics {
|
|||||||
const val x1 = ""
|
const val x1 = ""
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
<!ANNOTATION_TARGETS_NON_EXISTENT_ACCESSOR!>@get:Ann<!>
|
@get:Ann
|
||||||
val x2 = ""
|
val x2 = ""
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
<!ANNOTATION_TARGETS_NON_EXISTENT_ACCESSOR!>@get:Ann<!>
|
<!ANNOTATION_TARGETS_NON_EXISTENT_ACCESSOR!>@get:Ann<!>
|
||||||
private val x3 = ""
|
private val x3 = ""
|
||||||
|
|
||||||
|
@JvmStatic
|
||||||
|
<!ANNOTATION_TARGETS_NON_EXISTENT_ACCESSOR!>@get:Ann<!>
|
||||||
|
private val x4 = ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
@@ -98,6 +98,7 @@ public final class Statics {
|
|||||||
public const final val x1: kotlin.String = ""
|
public const final val x1: kotlin.String = ""
|
||||||
@kotlin.jvm.JvmStatic public final val x2: kotlin.String = ""
|
@kotlin.jvm.JvmStatic public final val x2: kotlin.String = ""
|
||||||
@kotlin.jvm.JvmStatic private final val x3: kotlin.String = ""
|
@kotlin.jvm.JvmStatic private final val x3: kotlin.String = ""
|
||||||
|
@kotlin.jvm.JvmStatic private final val x4: kotlin.String = ""
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
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 hashCode(): kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
|||||||
Reference in New Issue
Block a user