K2 JVM: Take JVM declarations conflicting error back
Since SimpleDiagnosticsCollectorWithSuppress have been replaced by
PendingDiagnosticsCollectorWithSuppress after commit 9add6f3d55,
diagnostics need to be committed now.
#KT-54366 Fixed
This commit is contained in:
@@ -38,6 +38,10 @@ open class KtDiagnosticReporterWithContext(
|
||||
) : DiagnosticReporter() {
|
||||
override fun report(diagnostic: KtDiagnostic?, context: DiagnosticContext) = diagnosticReporter.report(diagnostic, context)
|
||||
|
||||
override fun checkAndCommitReportsOn(element: AbstractKtSourceElement, context: DiagnosticContext?) {
|
||||
diagnosticReporter.checkAndCommitReportsOn(element, context)
|
||||
}
|
||||
|
||||
open fun at(sourceElement: AbstractKtSourceElement?, containingFilePath: String): DiagnosticContextImpl =
|
||||
DiagnosticContextImpl(sourceElement, containingFilePath)
|
||||
|
||||
@@ -81,6 +85,13 @@ open class KtDiagnosticReporterWithContext(
|
||||
sourceElement?.let { report(factory.on(it, a1, a2, positioningStrategy), this) }
|
||||
}
|
||||
|
||||
fun <A : Any> reportAndCommit(factory: KtDiagnosticFactory1<A>, a: A) {
|
||||
sourceElement?.let {
|
||||
reportOn(it, factory, a, this)
|
||||
checkAndCommitReportsOn(it, this)
|
||||
}
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
if (other !is DiagnosticContextImpl) return false
|
||||
|
||||
Reference in New Issue
Block a user