FIR: fix a bunch of issues after DiagnosticsReporter refactoring related to reporting diagnostic on null source

This commit is contained in:
Kirill Rakhman
2023-01-05 15:00:30 +01:00
committed by Space Team
parent a7edf5b83e
commit 69f2e8826a
27 changed files with 74 additions and 42 deletions
@@ -91,10 +91,10 @@ object FirNativeThrowsChecker : FirBasicDeclarationChecker() {
val (overriddenMember, overriddenThrows) = inherited.firstOrNull()
?: return true // Should not happen though.
if (decodeThrowsFilter(throwsAnnotation, context.session) != overriddenThrows) {
if (throwsAnnotation?.source != null && decodeThrowsFilter(throwsAnnotation, context.session) != overriddenThrows) {
val containingClassSymbol = overriddenMember.containingClassLookupTag()?.toFirRegularClassSymbol(context.session)
if (containingClassSymbol != null) {
reporter.reportOn(throwsAnnotation?.source, FirNativeErrors.INCOMPATIBLE_THROWS_OVERRIDE, containingClassSymbol, context)
reporter.reportOn(throwsAnnotation.source, FirNativeErrors.INCOMPATIBLE_THROWS_OVERRIDE, containingClassSymbol, context)
}
return false
}