[FIR] Fix backingField usage in FirVolatileAnnotationChecker

This commit is contained in:
Nikolay Lunyak
2021-08-20 02:59:45 +03:00
committed by TeamCityServer
parent e571de5942
commit d5ddd3cee3
@@ -19,7 +19,7 @@ object FirVolatileAnnotationChecker : FirPropertyChecker() {
override fun check(declaration: FirProperty, context: CheckerContext, reporter: DiagnosticReporter) {
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) {
reporter.reportOn(fieldAnnotation.source, FirJvmErrors.VOLATILE_ON_VALUE, context)
}