Report EXPLICIT_DELEGATION_CALL_REQUIRED on relevant element

^KT-38959 Fixed
This commit is contained in:
Vladimir Dolzhenko
2020-10-02 12:31:25 +02:00
committed by Vladimir Dolzhenko
parent 7af564c9f2
commit 5eac949b43
11 changed files with 92 additions and 27 deletions
@@ -274,6 +274,18 @@ abstract class BaseDiagnosticsTest : KotlinMultiFileTestWithJava<TestModule, Tes
whatDiagnosticsToConsider.value(it.diagnostic)
}
filteredDiagnostics.map { it.diagnostic }.forEach { diagnostic ->
val diagnosticElementTextRange = diagnostic.psiElement.textRange
diagnostic.textRanges.forEach {
check(diagnosticElementTextRange.contains(it)) {
"Annotation API violation:" +
" diagnostic text range $it has to be in range of" +
" diagnostic element ${diagnostic.psiElement} '${diagnostic.psiElement.text}'" +
" (factory ${diagnostic.factory.name}): $diagnosticElementTextRange"
}
}
}
actualDiagnostics.addAll(filteredDiagnostics)
val uncheckedDiagnostics = mutableListOf<PositionalTextDiagnostic>()