[FIR] Fix backingField usage in FirVolatileAnnotationChecker
This commit is contained in:
committed by
TeamCityServer
parent
e571de5942
commit
d5ddd3cee3
+1
-1
@@ -19,7 +19,7 @@ object FirVolatileAnnotationChecker : FirPropertyChecker() {
|
|||||||
override fun check(declaration: FirProperty, context: CheckerContext, reporter: DiagnosticReporter) {
|
override fun check(declaration: FirProperty, context: CheckerContext, reporter: DiagnosticReporter) {
|
||||||
if (declaration.source?.kind != FirRealSourceElementKind) return
|
if (declaration.source?.kind != FirRealSourceElementKind) return
|
||||||
|
|
||||||
val fieldAnnotation = declaration.backingFieldSymbol.getAnnotationByClassId(VOLATILE_ANNOTATION_CLASS_ID)
|
val fieldAnnotation = declaration.getAnnotationByClassId(VOLATILE_ANNOTATION_CLASS_ID)
|
||||||
if (fieldAnnotation != null && !declaration.isVar) {
|
if (fieldAnnotation != null && !declaration.isVar) {
|
||||||
reporter.reportOn(fieldAnnotation.source, FirJvmErrors.VOLATILE_ON_VALUE, context)
|
reporter.reportOn(fieldAnnotation.source, FirJvmErrors.VOLATILE_ON_VALUE, context)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user