[FIR] Enhance diagnostic DSL to be able to use concrete factories

Before this commit, things like DiagnosticFactory0<KtDeclaration>
were effectively unusable.
This commit is contained in:
Mikhail Glukhikh
2020-03-25 14:43:44 +03:00
parent a1d81aa15f
commit 2f63c8a46a
10 changed files with 142 additions and 123 deletions
@@ -36,7 +36,7 @@ abstract class AbstractFirDiagnosticsWithLightTreeTest : AbstractFirDiagnosticsT
val diagnostics = fileToDiagnostics[firFile] ?: emptyList()
val actualDiagnostics = diagnostics.groupBy {
require(it is FirLightDiagnostic<*>)
require(it is FirLightDiagnostic)
it.element.startOffset
}.mapValues { (_, diagnostics) -> diagnostics.map { it.factory.name }.countEntries() }