diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/common/fir/FirDiagnosticsCompilerResultsReporter.kt b/compiler/cli/src/org/jetbrains/kotlin/cli/common/fir/FirDiagnosticsCompilerResultsReporter.kt index b6e4328b465..045226be0fb 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/common/fir/FirDiagnosticsCompilerResultsReporter.kt +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/common/fir/FirDiagnosticsCompilerResultsReporter.kt @@ -17,7 +17,7 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDefaultErrorMessages import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnostic object FirDiagnosticsCompilerResultsReporter { - fun reportDiagnostics(diagnostics: Collection>, reporter: MessageCollector): Boolean { + fun reportDiagnostics(diagnostics: Collection, reporter: MessageCollector): Boolean { var hasErrors = false for (diagnostic in diagnostics.sortedWith(DiagnosticComparator)) { hasErrors = reportDiagnostic(diagnostic, reporter) || hasErrors @@ -27,7 +27,7 @@ object FirDiagnosticsCompilerResultsReporter { } @Suppress("UNUSED_PARAMETER") - private fun reportSpecialErrors(diagnostics: Collection>) { + private fun reportSpecialErrors(diagnostics: Collection) { /* * TODO: handle next diagnostics when they will be supported in FIR: * - INCOMPATIBLE_CLASS @@ -37,7 +37,7 @@ object FirDiagnosticsCompilerResultsReporter { */ } - private fun reportDiagnostic(diagnostic: FirDiagnostic<*>, reporter: MessageCollector): Boolean { + private fun reportDiagnostic(diagnostic: FirDiagnostic, reporter: MessageCollector): Boolean { if (!diagnostic.isValid) return false diagnostic.location()?.let { location -> val severity = AnalyzerWithCompilerReport.convertSeverity(diagnostic.severity) @@ -48,28 +48,28 @@ object FirDiagnosticsCompilerResultsReporter { return diagnostic.severity == Severity.ERROR } - private fun FirDiagnostic<*>.location(): CompilerMessageSourceLocation? = when (val element = element) { - is FirPsiSourceElement<*> -> element.location(this) + private fun FirDiagnostic.location(): CompilerMessageSourceLocation? = when (val element = element) { + is FirPsiSourceElement -> element.location(this) is FirLightSourceElement -> element.location(this) } - private fun FirPsiSourceElement<*>.location(diagnostic: FirDiagnostic<*>): CompilerMessageSourceLocation? { + private fun FirPsiSourceElement.location(diagnostic: FirDiagnostic): CompilerMessageSourceLocation? { val file = psi.containingFile return MessageUtil.psiFileToMessageLocation(file, file.name, DiagnosticUtils.getLineAndColumnRange(file, diagnostic.textRanges)) } @Suppress("UNUSED_PARAMETER") - private fun FirLightSourceElement.location(diagnostic: FirDiagnostic<*>): CompilerMessageSourceLocation? { + private fun FirLightSourceElement.location(diagnostic: FirDiagnostic): CompilerMessageSourceLocation? { // TODO: support light tree return null } - private object DiagnosticComparator : Comparator> { - override fun compare(o1: FirDiagnostic<*>, o2: FirDiagnostic<*>): Int { + private object DiagnosticComparator : Comparator { + override fun compare(o1: FirDiagnostic, o2: FirDiagnostic): Int { val element1 = o1.element val element2 = o1.element // TODO: support light tree - if (element1 !is FirPsiSourceElement<*> || element2 !is FirPsiSourceElement<*>) return 0 + if (element1 !is FirPsiSourceElement || element2 !is FirPsiSourceElement) return 0 val file1 = element1.psi.containingFile val file2 = element2.psi.containingFile diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/FirSourceUtils.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/FirSourceUtils.kt index 351fd70c89c..120a0270e70 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/FirSourceUtils.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/FirSourceUtils.kt @@ -20,7 +20,7 @@ fun FirSourceElement.getChild(types: TokenSet, index: Int = 0, depth: Int = -1): fun FirSourceElement.getChild(types: Set, index: Int = 0, depth: Int = -1): FirSourceElement? { return when (this) { - is FirPsiSourceElement<*> -> { + is FirPsiSourceElement -> { getChild(types, index, depth) } is FirLightSourceElement -> { @@ -30,7 +30,7 @@ fun FirSourceElement.getChild(types: Set, index: Int = 0, depth: I } } -private fun FirPsiSourceElement<*>.getChild(types: Set, index: Int, depth: Int): FirSourceElement? { +private fun FirPsiSourceElement.getChild(types: Set, index: Int, depth: Int): FirSourceElement? { val visitor = PsiElementFinderByType(types, index, depth) return visitor.find(psi)?.toFirPsiSourceElement() } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirKeywordUtils.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirKeywordUtils.kt index 818b6262829..4cd66216a55 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirKeywordUtils.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirKeywordUtils.kt @@ -84,7 +84,7 @@ sealed class FirModifier(val node: Node, val token: KtModifierKeywor fun FirSourceElement?.getModifierList(): FirModifierList? { return when (this) { null -> null - is FirPsiSourceElement<*> -> (psi as? KtModifierListOwner)?.modifierList?.let { FirModifierList.FirPsiModifierList(it) } + is FirPsiSourceElement -> (psi as? KtModifierListOwner)?.modifierList?.let { FirModifierList.FirPsiModifierList(it) } is FirLightSourceElement -> { val modifierListNode = lighterASTNode.getChildren(treeStructure).find { it?.tokenType == KtNodeTypes.MODIFIER_LIST } ?: return null @@ -103,6 +103,6 @@ fun FirElement.hasModifier(token: KtModifierKeywordToken): Boolean = token in so internal val FirSourceElement?.valOrVarKeyword: KtKeywordToken? get() = when (this) { null -> null - is FirPsiSourceElement<*> -> (psi as? KtValVarKeywordOwner)?.valOrVarKeyword?.let { it.node?.elementType as? KtKeywordToken } + is FirPsiSourceElement -> (psi as? KtValVarKeywordOwner)?.valOrVarKeyword?.let { it.node?.elementType as? KtKeywordToken } is FirLightSourceElement -> treeStructure.valOrVarKeyword(lighterASTNode)?.tokenType as? KtKeywordToken } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/SourceNavigator.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/SourceNavigator.kt index 914b3fe35c0..667e9e17613 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/SourceNavigator.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/SourceNavigator.kt @@ -32,7 +32,7 @@ interface SourceNavigator { fun forElement(e: FirElement): SourceNavigator = when (e.source) { is FirLightSourceElement -> lightTreeInstance - is FirPsiSourceElement<*> -> PsiSourceNavigator + is FirPsiSourceElement -> PsiSourceNavigator null -> lightTreeInstance //shouldn't matter } @@ -62,7 +62,7 @@ object PsiSourceNavigator : LightTreeSourceNavigator() { //Swallows incorrect casts!!! private inline fun FirElement.psi(): P? { - val psi = (source as? FirPsiSourceElement<*>)?.psi + val psi = (source as? FirPsiSourceElement)?.psi return psi as? P } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/context/CheckerContext.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/context/CheckerContext.kt index 991a870c85c..11a6fb4656a 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/context/CheckerContext.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/context/CheckerContext.kt @@ -10,7 +10,6 @@ import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnostic import org.jetbrains.kotlin.fir.declarations.FirDeclaration import org.jetbrains.kotlin.fir.expressions.FirGetClassCall -import org.jetbrains.kotlin.fir.expressions.FirQualifiedAccess import org.jetbrains.kotlin.fir.expressions.FirStatement import org.jetbrains.kotlin.fir.resolve.ImplicitReceiverStack import org.jetbrains.kotlin.fir.resolve.SessionHolder @@ -43,7 +42,7 @@ abstract class CheckerContext { allErrorsSuppressed: Boolean ): PersistentCheckerContext - fun isDiagnosticSuppressed(diagnostic: FirDiagnostic<*>): Boolean { + fun isDiagnosticSuppressed(diagnostic: FirDiagnostic): Boolean { val factory = diagnostic.factory val name = factory.name val suppressedByAll = when (factory.severity) { diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirAnnotationArgumentChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirAnnotationArgumentChecker.kt index 2f3a48b1f6d..44f6a0c343a 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirAnnotationArgumentChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirAnnotationArgumentChecker.kt @@ -22,7 +22,6 @@ import org.jetbrains.kotlin.fir.languageVersionSettings import org.jetbrains.kotlin.fir.resolve.fqName import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name -import org.jetbrains.kotlin.psi.KtExpression import org.jetbrains.kotlin.resolve.RequireKotlinConstants object FirAnnotationArgumentChecker : FirAnnotationCallChecker() { @@ -60,9 +59,9 @@ object FirAnnotationArgumentChecker : FirAnnotationCallChecker() { session: FirSession, reporter: DiagnosticReporter, context: CheckerContext - ): FirDiagnosticFactory0? { + ): FirDiagnosticFactory0? { - fun checkArgumentList(args: FirArgumentList): FirDiagnosticFactory0? { + fun checkArgumentList(args: FirArgumentList): FirDiagnosticFactory0? { var usedNonConst = false for (arg in args.arguments) { diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirForLoopChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirForLoopChecker.kt index 5c2a6a802b5..49cfa83ccb9 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirForLoopChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirForLoopChecker.kt @@ -5,7 +5,6 @@ package org.jetbrains.kotlin.fir.analysis.checkers.expression -import com.intellij.psi.PsiElement import org.jetbrains.kotlin.fir.FirFakeSourceElementKind import org.jetbrains.kotlin.fir.FirSourceElement import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext @@ -34,7 +33,6 @@ import org.jetbrains.kotlin.fir.resolve.diagnostics.ConeInapplicableCandidateErr import org.jetbrains.kotlin.fir.resolve.diagnostics.ConeUnresolvedNameError import org.jetbrains.kotlin.fir.symbols.AbstractFirBasedSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirNamedFunctionSymbol -import org.jetbrains.kotlin.psi.KtExpression import org.jetbrains.kotlin.resolve.calls.tower.isSuccess object FirForLoopChecker : FirBlockChecker() { @@ -95,10 +93,10 @@ object FirForLoopChecker : FirBlockChecker() { reporter: DiagnosticReporter, reportSource: FirSourceElement?, context: CheckerContext, - ambiguityFactory: FirDiagnosticFactory1>>, - missingFactory: FirDiagnosticFactory0, - noneApplicableFactory: FirDiagnosticFactory1>>? = null, - unsafeCallFactory: FirDiagnosticFactory0? = null, + ambiguityFactory: FirDiagnosticFactory1>>, + missingFactory: FirDiagnosticFactory0, + noneApplicableFactory: FirDiagnosticFactory1>>? = null, + unsafeCallFactory: FirDiagnosticFactory0? = null, ): Boolean { when (val calleeReference = call.calleeReference) { is FirErrorNamedReference -> { @@ -145,4 +143,4 @@ object FirForLoopChecker : FirBlockChecker() { } return false } -} \ No newline at end of file +} diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirFunctionReturnTypeMismatchChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirFunctionReturnTypeMismatchChecker.kt index 31fc0a0f01c..70f186af3be 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirFunctionReturnTypeMismatchChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirFunctionReturnTypeMismatchChecker.kt @@ -42,7 +42,7 @@ object FirFunctionReturnTypeMismatchChecker : FirReturnExpressionChecker() { isSubtypeForTypeMismatch(typeContext, subtype = resultExpression.smartcastType.coneType, supertype = functionReturnType) ) { reporter.reportOn( - returnExpressionSource, + resultExpression.source, SMARTCAST_IMPOSSIBLE, functionReturnType, resultExpression, @@ -51,11 +51,11 @@ object FirFunctionReturnTypeMismatchChecker : FirReturnExpressionChecker() { ) } else { reporter.reportOn( - resultExpression.source, + resultExpression.source, RETURN_TYPE_MISMATCH, - functionReturnType, - returnExpressionType, - targetElement, + functionReturnType, + returnExpressionType, + targetElement, context ) } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirReservedUnderscoreCheckers.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirReservedUnderscoreCheckers.kt index d798ed651ae..db7bcda24ce 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirReservedUnderscoreCheckers.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirReservedUnderscoreCheckers.kt @@ -10,13 +10,16 @@ import com.intellij.psi.PsiElement import com.intellij.psi.PsiNameIdentifierOwner import com.intellij.psi.impl.source.tree.LeafPsiElement import org.jetbrains.kotlin.KtNodeTypes -import org.jetbrains.kotlin.fir.* +import org.jetbrains.kotlin.fir.FirLightSourceElement +import org.jetbrains.kotlin.fir.FirPsiSourceElement +import org.jetbrains.kotlin.fir.FirSourceElement import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext import org.jetbrains.kotlin.fir.analysis.checkers.declaration.FirBasicDeclarationChecker import org.jetbrains.kotlin.fir.analysis.checkers.getChildren import org.jetbrains.kotlin.fir.analysis.diagnostics.* import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.expressions.* +import org.jetbrains.kotlin.fir.text import org.jetbrains.kotlin.psi.* import org.jetbrains.kotlin.psi.psiUtil.anyDescendantOfType import org.jetbrains.kotlin.psi.stubs.elements.KtDotQualifiedExpressionElementType @@ -37,7 +40,7 @@ object FirReservedUnderscoreExpressionChecker : FirBasicExpressionChecker() { isExpression = true ) } else if (expression is FirQualifiedAccess) { - if (source is FirPsiSourceElement<*>) { + if (source is FirPsiSourceElement) { reportIfUnderscoreInQualifiedAccess(source, expression, context, reporter) } else if (source is FirLightSourceElement) { reportIfUnderscoreInQualifiedAccess(source, expression, context, reporter) @@ -48,7 +51,7 @@ object FirReservedUnderscoreExpressionChecker : FirBasicExpressionChecker() { } } else if (expression is FirReturnExpression) { var labelName: String? = null - if (source is FirPsiSourceElement<*>) { + if (source is FirPsiSourceElement) { labelName = (source.psi.parent as? KtLabeledExpression)?.getLabelName() } else if (source is FirLightSourceElement) { val parent = source.treeStructure.getParent(source.lighterASTNode) @@ -63,7 +66,7 @@ object FirReservedUnderscoreExpressionChecker : FirBasicExpressionChecker() { } private fun reportIfUnderscoreInQualifiedAccess( - source: FirPsiSourceElement<*>, + source: FirPsiSourceElement, expression: FirStatement, context: CheckerContext, reporter: DiagnosticReporter @@ -145,7 +148,7 @@ private fun reportIfUnderscore( ) { val source = declaration.source val rawIdentifier = when (source) { - is FirPsiSourceElement<*> -> + is FirPsiSourceElement -> (source.psi as? PsiNameIdentifierOwner)?.nameIdentifier?.text is FirLightSourceElement -> source.treeStructure.nameIdentifier(source.lighterASTNode)?.toString() @@ -162,7 +165,7 @@ private fun reportIfUnderscore( } val isReportUnderscoreInReturnOrReceiverTypeRef = when (returnOrReceiverTypeRef) { - is FirPsiSourceElement<*> -> { + is FirPsiSourceElement -> { val psi = returnOrReceiverTypeRef.psi psi is KtTypeReference && psi.anyDescendantOfType { isUnderscore(it.text) } } @@ -203,4 +206,4 @@ private fun reportIfUnderscore( } } -private fun isUnderscore(text: CharSequence) = text.all { it == '_' } \ No newline at end of file +private fun isUnderscore(text: CharSequence) = text.all { it == '_' } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/CanBeReplacedWithOperatorAssignmentChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/CanBeReplacedWithOperatorAssignmentChecker.kt index 3af12232410..8c43383bd01 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/CanBeReplacedWithOperatorAssignmentChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/CanBeReplacedWithOperatorAssignmentChecker.kt @@ -41,7 +41,7 @@ object CanBeReplacedWithOperatorAssignmentChecker : FirVariableAssignmentChecker var needToReport = false val assignmentSource = expression.source - if (assignmentSource is FirPsiSourceElement<*>) { + if (assignmentSource is FirPsiSourceElement) { val lValuePsi = lValue.psi as? KtNameReferenceExpression ?: return val rValuePsi = rValue.psi as? KtBinaryExpression ?: return diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/CanBeValChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/CanBeValChecker.kt index 8068a831517..05e34dfd3ff 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/CanBeValChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/CanBeValChecker.kt @@ -40,7 +40,7 @@ object CanBeValChecker : AbstractFirPropertyInitializationChecker() { for (property in unprocessedProperties) { val source = property.fir.source - if (source is FirFakeSourceElement<*>) continue + if (source is FirFakeSourceElement) continue if (source?.elementType == KtNodeTypes.DESTRUCTURING_DECLARATION) continue propertiesCharacteristics[property] = EventOccurrencesRange.ZERO } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/EmptyRangeChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/EmptyRangeChecker.kt index 94295409437..e03d880bc7e 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/EmptyRangeChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/EmptyRangeChecker.kt @@ -17,7 +17,7 @@ import org.jetbrains.kotlin.fir.scopes.impl.FirIntegerOperatorCall object EmptyRangeChecker : FirFunctionCallChecker() { override fun check(expression: FirFunctionCall, context: CheckerContext, reporter: DiagnosticReporter) { - if (expression.source is FirFakeSourceElement<*>) return + if (expression.source is FirFakeSourceElement) return val left = expression.rangeLeft ?: return val right = expression.rangeRight ?: return diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/RedundantSingleExpressionStringTemplateChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/RedundantSingleExpressionStringTemplateChecker.kt index 6c6f1b6ab73..65bdb9ad66a 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/RedundantSingleExpressionStringTemplateChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/RedundantSingleExpressionStringTemplateChecker.kt @@ -20,9 +20,9 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.reportOn import org.jetbrains.kotlin.fir.expressions.FirStatement import org.jetbrains.kotlin.fir.expressions.FirStringConcatenationCall import org.jetbrains.kotlin.fir.expressions.arguments -import org.jetbrains.kotlin.name.StandardClassIds import org.jetbrains.kotlin.fir.types.classId import org.jetbrains.kotlin.fir.types.coneType +import org.jetbrains.kotlin.name.StandardClassIds import org.jetbrains.kotlin.psi.KtStringTemplateExpression object RedundantSingleExpressionStringTemplateChecker : FirStringConcatenationCallChecker() { @@ -38,7 +38,7 @@ object RedundantSingleExpressionStringTemplateChecker : FirStringConcatenationCa private fun FirStatement.stringParentChildrenCount(): Int? { return when (val source = source) { - is FirPsiSourceElement<*> -> source.psi.stringParentChildrenCount() + is FirPsiSourceElement -> source.psi.stringParentChildrenCount() is FirLightSourceElement -> source.lighterASTNode.stringParentChildrenCount(source) null -> null } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/RedundantVisibilityModifierSyntaxChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/RedundantVisibilityModifierSyntaxChecker.kt index af7b7b00859..0758fe5c5d0 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/RedundantVisibilityModifierSyntaxChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/extended/RedundantVisibilityModifierSyntaxChecker.kt @@ -11,7 +11,6 @@ import org.jetbrains.kotlin.descriptors.Visibilities import org.jetbrains.kotlin.descriptors.Visibility import org.jetbrains.kotlin.fir.FirFakeSourceElement import org.jetbrains.kotlin.fir.FirFakeSourceElementKind -import org.jetbrains.kotlin.fir.FirPsiSourceElement import org.jetbrains.kotlin.fir.FirSourceElement import org.jetbrains.kotlin.fir.analysis.checkers.* import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext @@ -32,7 +31,7 @@ object RedundantVisibilityModifierSyntaxChecker : FirDeclarationSyntaxChecker) return + if (source is FirFakeSourceElement) return if ( element !is FirMemberDeclaration && !(element is FirPropertyAccessor && element.visibility == context.containingPropertyVisibility) diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/syntax/FirAnonymousFunctionSyntaxChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/syntax/FirAnonymousFunctionSyntaxChecker.kt index 5ce467812ab..d5b02082e82 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/syntax/FirAnonymousFunctionSyntaxChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/syntax/FirAnonymousFunctionSyntaxChecker.kt @@ -18,11 +18,12 @@ import org.jetbrains.kotlin.psi.KtFunction object FirAnonymousFunctionSyntaxChecker : FirExpressionSyntaxChecker() { override fun checkPsi( element: FirAnonymousFunction, - source: FirPsiSourceElement, + source: FirPsiSourceElement, + psi: KtFunction, context: CheckerContext, reporter: DiagnosticReporter ) { - if (source.psi.typeParameterList != null) { + if (psi.typeParameterList != null) { reporter.reportOn( source, FirErrors.TYPE_PARAMETERS_NOT_ALLOWED, diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/syntax/FirDelegationInInterfaceSyntaxChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/syntax/FirDelegationInInterfaceSyntaxChecker.kt index 10d3f636da6..a87842fd84a 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/syntax/FirDelegationInInterfaceSyntaxChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/syntax/FirDelegationInInterfaceSyntaxChecker.kt @@ -6,13 +6,15 @@ package org.jetbrains.kotlin.fir.analysis.checkers.syntax import org.jetbrains.kotlin.KtNodeTypes -import org.jetbrains.kotlin.fir.* +import org.jetbrains.kotlin.fir.FirPsiSourceElement +import org.jetbrains.kotlin.fir.FirSourceElement import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors import org.jetbrains.kotlin.fir.analysis.diagnostics.reportOn import org.jetbrains.kotlin.fir.declarations.FirRegularClass import org.jetbrains.kotlin.fir.declarations.isInterface +import org.jetbrains.kotlin.fir.psi import org.jetbrains.kotlin.psi.KtClass import org.jetbrains.kotlin.psi.KtDelegatedSuperTypeEntry @@ -22,7 +24,8 @@ object FirDelegationInInterfaceSyntaxChecker : FirDeclarationSyntaxChecker, + source: FirPsiSourceElement, + psi: KtClass, context: CheckerContext, reporter: DiagnosticReporter ) { diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/syntax/FirFunctionTypeParametersSyntaxChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/syntax/FirFunctionTypeParametersSyntaxChecker.kt index 02057ad9a0a..de9f4c645d5 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/syntax/FirFunctionTypeParametersSyntaxChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/syntax/FirFunctionTypeParametersSyntaxChecker.kt @@ -20,12 +20,13 @@ object FirFunctionTypeParametersSyntaxChecker : FirDeclarationSyntaxChecker, + source: FirPsiSourceElement, + psi: KtFunction, context: CheckerContext, reporter: DiagnosticReporter ) { - val typeParamsNode = source.psi.typeParameterList - val nameNode = source.psi.nameIdentifier + val typeParamsNode = psi.typeParameterList + val nameNode = psi.nameIdentifier if (typeParamsNode != null && nameNode != null && typeParamsNode.startOffset > nameNode.startOffset) { reporter.reportOn( diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/syntax/FirSyntaxChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/syntax/FirSyntaxChecker.kt index ff5596a15f4..4c91d96c6c1 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/syntax/FirSyntaxChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/syntax/FirSyntaxChecker.kt @@ -27,7 +27,7 @@ interface FirSyntaxChecker { if (!isApplicable(element, source)) return @Suppress("UNCHECKED_CAST") when (source) { - is FirPsiSourceElement<*> -> checkPsi(element, source as FirPsiSourceElement

, context, reporter) + is FirPsiSourceElement -> checkPsi(element, source, source.psi as P, context, reporter) is FirLightSourceElement -> checkLightTree(element, source, context, reporter) } } @@ -37,7 +37,7 @@ interface FirSyntaxChecker { /** * By default psi tree should be equivalent to light tree and can be processed the same way */ - fun checkPsi(element: D, source: FirPsiSourceElement

, context: CheckerContext, reporter: DiagnosticReporter) { + fun checkPsi(element: D, source: FirPsiSourceElement, psi: P, context: CheckerContext, reporter: DiagnosticReporter) { checkLightTree(element, source, context, reporter) } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/syntax/FirTypeParameterSyntaxChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/syntax/FirTypeParameterSyntaxChecker.kt index 9b4ac21c418..8d0bed13e87 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/syntax/FirTypeParameterSyntaxChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/syntax/FirTypeParameterSyntaxChecker.kt @@ -24,7 +24,8 @@ object FirTypeParameterSyntaxChecker : FirDeclarationSyntaxChecker, + source: FirPsiSourceElement, + psi: KtTypeParameter, context: CheckerContext, reporter: DiagnosticReporter ) { diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/DiagnosticReporter.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/DiagnosticReporter.kt index 9c11c5b0ec3..db13a8fd0b2 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/DiagnosticReporter.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/DiagnosticReporter.kt @@ -5,7 +5,6 @@ package org.jetbrains.kotlin.fir.analysis.diagnostics -import com.intellij.psi.PsiElement import org.jetbrains.kotlin.fir.FirAnnotationContainer import org.jetbrains.kotlin.fir.FirElement import org.jetbrains.kotlin.fir.FirSourceElement @@ -13,65 +12,65 @@ import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext import org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollector abstract class DiagnosticReporter { - abstract fun report(diagnostic: FirDiagnostic<*>?, context: CheckerContext) + abstract fun report(diagnostic: FirDiagnostic?, context: CheckerContext) } @OptIn(InternalDiagnosticFactoryMethod::class) -fun

DiagnosticReporter.reportOn( +fun DiagnosticReporter.reportOn( source: FirSourceElement?, - factory: FirDiagnosticFactory0

, + factory: FirDiagnosticFactory0, context: CheckerContext, - positioningStrategy: SourceElementPositioningStrategy

? = null + positioningStrategy: SourceElementPositioningStrategy? = null ) { source?.let { report(factory.on(it, positioningStrategy), context) } } @OptIn(InternalDiagnosticFactoryMethod::class) -fun

DiagnosticReporter.reportOn( +fun DiagnosticReporter.reportOn( source: FirSourceElement?, - factory: FirDiagnosticFactory1, + factory: FirDiagnosticFactory1, a: A, context: CheckerContext, - positioningStrategy: SourceElementPositioningStrategy

? = null + positioningStrategy: SourceElementPositioningStrategy? = null ) { source?.let { report(factory.on(it, a, positioningStrategy), context) } } @OptIn(InternalDiagnosticFactoryMethod::class) -fun

DiagnosticReporter.reportOn( +fun DiagnosticReporter.reportOn( source: FirSourceElement?, - factory: FirDiagnosticFactory2, + factory: FirDiagnosticFactory2, a: A, b: B, context: CheckerContext, - positioningStrategy: SourceElementPositioningStrategy

? = null + positioningStrategy: SourceElementPositioningStrategy? = null ) { source?.let { report(factory.on(it, a, b, positioningStrategy), context) } } @OptIn(InternalDiagnosticFactoryMethod::class) -fun

DiagnosticReporter.reportOn( +fun DiagnosticReporter.reportOn( source: FirSourceElement?, - factory: FirDiagnosticFactory3, + factory: FirDiagnosticFactory3, a: A, b: B, c: C, context: CheckerContext, - positioningStrategy: SourceElementPositioningStrategy

? = null + positioningStrategy: SourceElementPositioningStrategy? = null ) { source?.let { report(factory.on(it, a, b, c, positioningStrategy), context) } } @OptIn(InternalDiagnosticFactoryMethod::class) -fun

DiagnosticReporter.reportOn( +fun DiagnosticReporter.reportOn( source: FirSourceElement?, - factory: FirDiagnosticFactory4, + factory: FirDiagnosticFactory4, a: A, b: B, c: C, d: D, context: CheckerContext, - positioningStrategy: SourceElementPositioningStrategy

? = null + positioningStrategy: SourceElementPositioningStrategy? = null ) { source?.let { report(factory.on(it, a, b, c, d, positioningStrategy), context) } } @@ -96,65 +95,65 @@ inline fun withSuppressedDiagnostics( f(context) } -fun

DiagnosticReporter.reportOnWithSuppression( +fun DiagnosticReporter.reportOnWithSuppression( element: FirElement, - factory: FirDiagnosticFactory0

, + factory: FirDiagnosticFactory0, context: CheckerContext, - positioningStrategy: SourceElementPositioningStrategy

? = null + positioningStrategy: SourceElementPositioningStrategy? = null ) { withSuppressedDiagnostics(element, context) { reportOn(element.source, factory, it, positioningStrategy) } } -fun

DiagnosticReporter.reportOnWithSuppression( +fun DiagnosticReporter.reportOnWithSuppression( element: FirElement, - factory: FirDiagnosticFactory1, + factory: FirDiagnosticFactory1, a: A, context: CheckerContext, - positioningStrategy: SourceElementPositioningStrategy

? = null + positioningStrategy: SourceElementPositioningStrategy? = null ) { withSuppressedDiagnostics(element, context) { reportOn(element.source, factory, a, it, positioningStrategy) } } -fun

DiagnosticReporter.reportOnWithSuppression( +fun DiagnosticReporter.reportOnWithSuppression( element: FirElement, - factory: FirDiagnosticFactory2, + factory: FirDiagnosticFactory2, a: A, b: B, context: CheckerContext, - positioningStrategy: SourceElementPositioningStrategy

? = null + positioningStrategy: SourceElementPositioningStrategy? = null ) { withSuppressedDiagnostics(element, context) { reportOn(element.source, factory, a, b, it, positioningStrategy) } } -fun

DiagnosticReporter.reportOnWithSuppression( +fun DiagnosticReporter.reportOnWithSuppression( element: FirElement, - factory: FirDiagnosticFactory3, + factory: FirDiagnosticFactory3, a: A, b: B, c: C, context: CheckerContext, - positioningStrategy: SourceElementPositioningStrategy

? = null + positioningStrategy: SourceElementPositioningStrategy? = null ) { withSuppressedDiagnostics(element, context) { reportOn(element.source, factory, a, b, c, it, positioningStrategy) } } -fun

DiagnosticReporter.reportOnWithSuppression( +fun DiagnosticReporter.reportOnWithSuppression( element: FirElement, - factory: FirDiagnosticFactory4, + factory: FirDiagnosticFactory4, a: A, b: B, c: C, d: D, context: CheckerContext, - positioningStrategy: SourceElementPositioningStrategy

? = null + positioningStrategy: SourceElementPositioningStrategy? = null ) { withSuppressedDiagnostics(element, context) { reportOn(element.source, factory, a, b, c, d, it, positioningStrategy) diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt index 585f2ad054f..3911cf3eb35 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt @@ -5,7 +5,7 @@ package org.jetbrains.kotlin.fir.analysis.diagnostics -import org.jetbrains.kotlin.diagnostics.rendering.* +import org.jetbrains.kotlin.diagnostics.rendering.LanguageFeatureMessageRenderer import org.jetbrains.kotlin.diagnostics.rendering.Renderers.RENDER_POSITION_VARIANCE import org.jetbrains.kotlin.diagnostics.rendering.Renderers.STRING import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.AMBIGUOUS_CALLS @@ -379,10 +379,10 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.WRONG_SETTER_RETU @Suppress("unused") class FirDefaultErrorMessages { companion object { - fun getRendererForDiagnostic(diagnostic: FirDiagnostic<*>): FirDiagnosticRenderer> { + fun getRendererForDiagnostic(diagnostic: FirDiagnostic): FirDiagnosticRenderer { val factory = diagnostic.factory @Suppress("UNCHECKED_CAST") - return (MAP[factory] ?: factory.firRenderer) as FirDiagnosticRenderer> + return (MAP[factory] ?: factory.firRenderer) } // * - The old FE reports these diagnostics with additional parameters diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnostic.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnostic.kt index 1bf8907bcb2..ab7c1d152f6 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnostic.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnostic.kt @@ -15,11 +15,11 @@ import org.jetbrains.kotlin.fir.FirSourceElement // ------------------------------ diagnostics ------------------------------ -sealed class FirDiagnostic { - abstract val element: E +sealed class FirDiagnostic { + abstract val element: FirSourceElement abstract val severity: Severity - abstract val factory: AbstractFirDiagnosticFactory<*, *> - abstract val positioningStrategy: SourceElementPositioningStrategy<*> + abstract val factory: AbstractFirDiagnosticFactory + abstract val positioningStrategy: SourceElementPositioningStrategy val textRanges: List get() = positioningStrategy.markDiagnostic(this) @@ -28,41 +28,41 @@ sealed class FirDiagnostic { get() = positioningStrategy.isValid(element) } -sealed class FirSimpleDiagnostic : FirDiagnostic() { - abstract override val factory: FirDiagnosticFactory0<*> +sealed class FirSimpleDiagnostic : FirDiagnostic() { + abstract override val factory: FirDiagnosticFactory0 } -sealed class FirDiagnosticWithParameters1 : FirDiagnostic() { +sealed class FirDiagnosticWithParameters1 : FirDiagnostic() { abstract val a: A - abstract override val factory: FirDiagnosticFactory1<*, A> + abstract override val factory: FirDiagnosticFactory1 } -sealed class FirDiagnosticWithParameters2 : FirDiagnostic() { +sealed class FirDiagnosticWithParameters2 : FirDiagnostic() { abstract val a: A abstract val b: B - abstract override val factory: FirDiagnosticFactory2<*, A, B> + abstract override val factory: FirDiagnosticFactory2 } -sealed class FirDiagnosticWithParameters3 : FirDiagnostic() { +sealed class FirDiagnosticWithParameters3 : FirDiagnostic() { abstract val a: A abstract val b: B abstract val c: C - abstract override val factory: FirDiagnosticFactory3<*, A, B, C> + abstract override val factory: FirDiagnosticFactory3 } -sealed class FirDiagnosticWithParameters4 : FirDiagnostic() { +sealed class FirDiagnosticWithParameters4 : FirDiagnostic() { abstract val a: A abstract val b: B abstract val c: C abstract val d: D - abstract override val factory: FirDiagnosticFactory4<*, A, B, C, D> + abstract override val factory: FirDiagnosticFactory4 } // ------------------------------ psi diagnostics ------------------------------ -interface FirPsiDiagnostic

{ - val factory: AbstractFirDiagnosticFactory<*, P> - val element: FirPsiSourceElement

+interface FirPsiDiagnostic { + val factory: AbstractFirDiagnosticFactory + val element: FirPsiSourceElement val textRanges: List val severity: Severity @@ -73,50 +73,50 @@ interface FirPsiDiagnostic

{ get() = psiElement.containingFile } -data class FirPsiSimpleDiagnostic

( - override val element: FirPsiSourceElement

, +data class FirPsiSimpleDiagnostic( + override val element: FirPsiSourceElement, override val severity: Severity, - override val factory: FirDiagnosticFactory0

, - override val positioningStrategy: SourceElementPositioningStrategy<*> -) : FirSimpleDiagnostic>(), FirPsiDiagnostic

+ override val factory: FirDiagnosticFactory0, + override val positioningStrategy: SourceElementPositioningStrategy +) : FirSimpleDiagnostic(), FirPsiDiagnostic -data class FirPsiDiagnosticWithParameters1

( - override val element: FirPsiSourceElement

, +data class FirPsiDiagnosticWithParameters1( + override val element: FirPsiSourceElement, override val a: A, override val severity: Severity, - override val factory: FirDiagnosticFactory1, - override val positioningStrategy: SourceElementPositioningStrategy<*> -) : FirDiagnosticWithParameters1, A>(), FirPsiDiagnostic

+ override val factory: FirDiagnosticFactory1, + override val positioningStrategy: SourceElementPositioningStrategy +) : FirDiagnosticWithParameters1(), FirPsiDiagnostic -data class FirPsiDiagnosticWithParameters2

( - override val element: FirPsiSourceElement

, +data class FirPsiDiagnosticWithParameters2( + override val element: FirPsiSourceElement, override val a: A, override val b: B, override val severity: Severity, - override val factory: FirDiagnosticFactory2, - override val positioningStrategy: SourceElementPositioningStrategy<*> -) : FirDiagnosticWithParameters2, A, B>(), FirPsiDiagnostic

+ override val factory: FirDiagnosticFactory2, + override val positioningStrategy: SourceElementPositioningStrategy +) : FirDiagnosticWithParameters2(), FirPsiDiagnostic -data class FirPsiDiagnosticWithParameters3

( - override val element: FirPsiSourceElement

, +data class FirPsiDiagnosticWithParameters3( + override val element: FirPsiSourceElement, override val a: A, override val b: B, override val c: C, override val severity: Severity, - override val factory: FirDiagnosticFactory3, - override val positioningStrategy: SourceElementPositioningStrategy<*> -) : FirDiagnosticWithParameters3, A, B, C>(), FirPsiDiagnostic

+ override val factory: FirDiagnosticFactory3, + override val positioningStrategy: SourceElementPositioningStrategy +) : FirDiagnosticWithParameters3(), FirPsiDiagnostic -data class FirPsiDiagnosticWithParameters4

( - override val element: FirPsiSourceElement

, +data class FirPsiDiagnosticWithParameters4( + override val element: FirPsiSourceElement, override val a: A, override val b: B, override val c: C, override val d: D, override val severity: Severity, - override val factory: FirDiagnosticFactory4, - override val positioningStrategy: SourceElementPositioningStrategy<*> -) : FirDiagnosticWithParameters4, A, B, C, D>(), FirPsiDiagnostic

+ override val factory: FirDiagnosticFactory4, + override val positioningStrategy: SourceElementPositioningStrategy +) : FirDiagnosticWithParameters4(), FirPsiDiagnostic // ------------------------------ light tree diagnostics ------------------------------ @@ -127,26 +127,26 @@ interface FirLightDiagnostic { data class FirLightSimpleDiagnostic( override val element: FirLightSourceElement, override val severity: Severity, - override val factory: FirDiagnosticFactory0<*>, - override val positioningStrategy: SourceElementPositioningStrategy<*> -) : FirSimpleDiagnostic(), FirLightDiagnostic + override val factory: FirDiagnosticFactory0, + override val positioningStrategy: SourceElementPositioningStrategy +) : FirSimpleDiagnostic(), FirLightDiagnostic data class FirLightDiagnosticWithParameters1( override val element: FirLightSourceElement, override val a: A, override val severity: Severity, - override val factory: FirDiagnosticFactory1<*, A>, - override val positioningStrategy: SourceElementPositioningStrategy<*> -) : FirDiagnosticWithParameters1(), FirLightDiagnostic + override val factory: FirDiagnosticFactory1, + override val positioningStrategy: SourceElementPositioningStrategy +) : FirDiagnosticWithParameters1(), FirLightDiagnostic data class FirLightDiagnosticWithParameters2( override val element: FirLightSourceElement, override val a: A, override val b: B, override val severity: Severity, - override val factory: FirDiagnosticFactory2<*, A, B>, - override val positioningStrategy: SourceElementPositioningStrategy<*> -) : FirDiagnosticWithParameters2(), FirLightDiagnostic + override val factory: FirDiagnosticFactory2, + override val positioningStrategy: SourceElementPositioningStrategy +) : FirDiagnosticWithParameters2(), FirLightDiagnostic data class FirLightDiagnosticWithParameters3( override val element: FirLightSourceElement, @@ -154,9 +154,9 @@ data class FirLightDiagnosticWithParameters3( override val b: B, override val c: C, override val severity: Severity, - override val factory: FirDiagnosticFactory3<*, A, B, C>, - override val positioningStrategy: SourceElementPositioningStrategy<*> -) : FirDiagnosticWithParameters3(), FirLightDiagnostic + override val factory: FirDiagnosticFactory3, + override val positioningStrategy: SourceElementPositioningStrategy +) : FirDiagnosticWithParameters3(), FirLightDiagnostic data class FirLightDiagnosticWithParameters4( override val element: FirLightSourceElement, @@ -165,6 +165,6 @@ data class FirLightDiagnosticWithParameters4( override val c: C, override val d: D, override val severity: Severity, - override val factory: FirDiagnosticFactory4<*, A, B, C, D>, - override val positioningStrategy: SourceElementPositioningStrategy<*> -) : FirDiagnosticWithParameters4(), FirLightDiagnostic + override val factory: FirDiagnosticFactory4, + override val positioningStrategy: SourceElementPositioningStrategy +) : FirDiagnosticWithParameters4(), FirLightDiagnostic diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticFactory.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticFactory.kt index ee3854906a0..e7a40ac8211 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticFactory.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticFactory.kt @@ -2,7 +2,6 @@ package org.jetbrains.kotlin.fir.analysis.diagnostics -import com.intellij.psi.PsiElement import org.jetbrains.kotlin.diagnostics.Severity import org.jetbrains.kotlin.fir.FirLightSourceElement import org.jetbrains.kotlin.fir.FirPsiSourceElement @@ -12,31 +11,31 @@ import kotlin.reflect.KClass @RequiresOptIn("Please use DiagnosticReporter.reportOn method if possible") annotation class InternalDiagnosticFactoryMethod -sealed class AbstractFirDiagnosticFactory, P : PsiElement>( +sealed class AbstractFirDiagnosticFactory( val name: String, val severity: Severity, - val defaultPositioningStrategy: SourceElementPositioningStrategy

, + val defaultPositioningStrategy: SourceElementPositioningStrategy, val psiType: KClass<*> ) { - abstract val firRenderer: FirDiagnosticRenderer + abstract val firRenderer: FirDiagnosticRenderer } -class FirDiagnosticFactory0

( +class FirDiagnosticFactory0( name: String, severity: Severity, - defaultPositioningStrategy: SourceElementPositioningStrategy

, + defaultPositioningStrategy: SourceElementPositioningStrategy, psiType: KClass<*> -) : AbstractFirDiagnosticFactory, P>(name, severity, defaultPositioningStrategy, psiType) { - override val firRenderer: FirDiagnosticRenderer> = SimpleFirDiagnosticRenderer("") +) : AbstractFirDiagnosticFactory(name, severity, defaultPositioningStrategy, psiType) { + override val firRenderer: FirDiagnosticRenderer = SimpleFirDiagnosticRenderer("") @InternalDiagnosticFactoryMethod fun on( element: FirSourceElement, - positioningStrategy: SourceElementPositioningStrategy

? - ): FirSimpleDiagnostic<*> { + positioningStrategy: SourceElementPositioningStrategy? + ): FirSimpleDiagnostic { return when (element) { - is FirPsiSourceElement<*> -> FirPsiSimpleDiagnostic( - element as FirPsiSourceElement

, severity, this, positioningStrategy ?: defaultPositioningStrategy + is FirPsiSourceElement -> FirPsiSimpleDiagnostic( + element, severity, this, positioningStrategy ?: defaultPositioningStrategy ) is FirLightSourceElement -> FirLightSimpleDiagnostic(element, severity, this, positioningStrategy ?: defaultPositioningStrategy) else -> incorrectElement(element) @@ -44,13 +43,13 @@ class FirDiagnosticFactory0

( } } -class FirDiagnosticFactory1

( +class FirDiagnosticFactory1( name: String, severity: Severity, - defaultPositioningStrategy: SourceElementPositioningStrategy

, + defaultPositioningStrategy: SourceElementPositioningStrategy, psiType: KClass<*> -) : AbstractFirDiagnosticFactory, P>(name, severity, defaultPositioningStrategy, psiType) { - override val firRenderer: FirDiagnosticRenderer> = FirDiagnosticWithParameters1Renderer( +) : AbstractFirDiagnosticFactory(name, severity, defaultPositioningStrategy, psiType) { + override val firRenderer: FirDiagnosticRenderer = FirDiagnosticWithParameters1Renderer( "{0}", FirDiagnosticRenderers.TO_STRING ) @@ -59,11 +58,11 @@ class FirDiagnosticFactory1

( fun on( element: FirSourceElement, a: A, - positioningStrategy: SourceElementPositioningStrategy

? - ): FirDiagnosticWithParameters1<*, A> { + positioningStrategy: SourceElementPositioningStrategy? + ): FirDiagnosticWithParameters1 { return when (element) { - is FirPsiSourceElement<*> -> FirPsiDiagnosticWithParameters1( - element as FirPsiSourceElement

, a, severity, this, positioningStrategy ?: defaultPositioningStrategy + is FirPsiSourceElement -> FirPsiDiagnosticWithParameters1( + element, a, severity, this, positioningStrategy ?: defaultPositioningStrategy ) is FirLightSourceElement -> FirLightDiagnosticWithParameters1( element, @@ -77,13 +76,13 @@ class FirDiagnosticFactory1

( } } -class FirDiagnosticFactory2

( +class FirDiagnosticFactory2( name: String, severity: Severity, - defaultPositioningStrategy: SourceElementPositioningStrategy

, + defaultPositioningStrategy: SourceElementPositioningStrategy, psiType: KClass<*> -) : AbstractFirDiagnosticFactory, P>(name, severity, defaultPositioningStrategy, psiType) { - override val firRenderer: FirDiagnosticRenderer> = FirDiagnosticWithParameters2Renderer( +) : AbstractFirDiagnosticFactory(name, severity, defaultPositioningStrategy, psiType) { + override val firRenderer: FirDiagnosticRenderer = FirDiagnosticWithParameters2Renderer( "{0}, {1}", FirDiagnosticRenderers.TO_STRING, FirDiagnosticRenderers.TO_STRING @@ -94,11 +93,11 @@ class FirDiagnosticFactory2

( element: FirSourceElement, a: A, b: B, - positioningStrategy: SourceElementPositioningStrategy

? - ): FirDiagnosticWithParameters2<*, A, B> { + positioningStrategy: SourceElementPositioningStrategy? + ): FirDiagnosticWithParameters2 { return when (element) { - is FirPsiSourceElement<*> -> FirPsiDiagnosticWithParameters2( - element as FirPsiSourceElement

, a, b, severity, this, positioningStrategy ?: defaultPositioningStrategy + is FirPsiSourceElement -> FirPsiDiagnosticWithParameters2( + element, a, b, severity, this, positioningStrategy ?: defaultPositioningStrategy ) is FirLightSourceElement -> FirLightDiagnosticWithParameters2( element, @@ -113,13 +112,13 @@ class FirDiagnosticFactory2

( } } -class FirDiagnosticFactory3

( +class FirDiagnosticFactory3( name: String, severity: Severity, - defaultPositioningStrategy: SourceElementPositioningStrategy

, + defaultPositioningStrategy: SourceElementPositioningStrategy, psiType: KClass<*> -) : AbstractFirDiagnosticFactory, P>(name, severity, defaultPositioningStrategy, psiType) { - override val firRenderer: FirDiagnosticRenderer> = FirDiagnosticWithParameters3Renderer( +) : AbstractFirDiagnosticFactory(name, severity, defaultPositioningStrategy, psiType) { + override val firRenderer: FirDiagnosticRenderer = FirDiagnosticWithParameters3Renderer( "{0}, {1}, {2}", FirDiagnosticRenderers.TO_STRING, FirDiagnosticRenderers.TO_STRING, @@ -132,11 +131,11 @@ class FirDiagnosticFactory3

( a: A, b: B, c: C, - positioningStrategy: SourceElementPositioningStrategy

? - ): FirDiagnosticWithParameters3<*, A, B, C> { + positioningStrategy: SourceElementPositioningStrategy? + ): FirDiagnosticWithParameters3 { return when (element) { - is FirPsiSourceElement<*> -> FirPsiDiagnosticWithParameters3( - element as FirPsiSourceElement

, a, b, c, severity, this, positioningStrategy ?: defaultPositioningStrategy + is FirPsiSourceElement -> FirPsiDiagnosticWithParameters3( + element, a, b, c, severity, this, positioningStrategy ?: defaultPositioningStrategy ) is FirLightSourceElement -> FirLightDiagnosticWithParameters3( element, @@ -152,13 +151,13 @@ class FirDiagnosticFactory3

( } } -class FirDiagnosticFactory4

( +class FirDiagnosticFactory4( name: String, severity: Severity, - defaultPositioningStrategy: SourceElementPositioningStrategy

, + defaultPositioningStrategy: SourceElementPositioningStrategy, psiType: KClass<*> -) : AbstractFirDiagnosticFactory, P>(name, severity, defaultPositioningStrategy, psiType) { - override val firRenderer: FirDiagnosticRenderer> = FirDiagnosticWithParameters4Renderer( +) : AbstractFirDiagnosticFactory(name, severity, defaultPositioningStrategy, psiType) { + override val firRenderer: FirDiagnosticRenderer = FirDiagnosticWithParameters4Renderer( "{0}, {1}, {2}, {3}", FirDiagnosticRenderers.TO_STRING, FirDiagnosticRenderers.TO_STRING, @@ -173,11 +172,11 @@ class FirDiagnosticFactory4

( b: B, c: C, d: D, - positioningStrategy: SourceElementPositioningStrategy

? - ): FirDiagnosticWithParameters4<*, A, B, C, D> { + positioningStrategy: SourceElementPositioningStrategy? + ): FirDiagnosticWithParameters4 { return when (element) { - is FirPsiSourceElement<*> -> FirPsiDiagnosticWithParameters4( - element as FirPsiSourceElement

, a, b, c, d, severity, this, positioningStrategy ?: defaultPositioningStrategy + is FirPsiSourceElement -> FirPsiDiagnosticWithParameters4( + element, a, b, c, d, severity, this, positioningStrategy ?: defaultPositioningStrategy ) is FirLightSourceElement -> FirLightDiagnosticWithParameters4( element, diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticFactoryDsl.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticFactoryDsl.kt index c62dd346526..da4ab3407eb 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticFactoryDsl.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticFactoryDsl.kt @@ -12,107 +12,107 @@ import kotlin.reflect.KClass import kotlin.reflect.KProperty inline fun warning0( - positioningStrategy: SourceElementPositioningStrategy

= SourceElementPositioningStrategy.DEFAULT -): DiagnosticFactory0DelegateProvider

{ + positioningStrategy: SourceElementPositioningStrategy = SourceElementPositioningStrategy.DEFAULT +): DiagnosticFactory0DelegateProvider { return DiagnosticFactory0DelegateProvider(Severity.WARNING, positioningStrategy, P::class) } inline fun warning1( - positioningStrategy: SourceElementPositioningStrategy

= SourceElementPositioningStrategy.DEFAULT -): DiagnosticFactory1DelegateProvider { + positioningStrategy: SourceElementPositioningStrategy = SourceElementPositioningStrategy.DEFAULT +): DiagnosticFactory1DelegateProvider { return DiagnosticFactory1DelegateProvider(Severity.WARNING, positioningStrategy, P::class) } inline fun warning2( - positioningStrategy: SourceElementPositioningStrategy

= SourceElementPositioningStrategy.DEFAULT -): DiagnosticFactory2DelegateProvider { + positioningStrategy: SourceElementPositioningStrategy = SourceElementPositioningStrategy.DEFAULT +): DiagnosticFactory2DelegateProvider { return DiagnosticFactory2DelegateProvider(Severity.WARNING, positioningStrategy, P::class) } inline fun warning3( - positioningStrategy: SourceElementPositioningStrategy

= SourceElementPositioningStrategy.DEFAULT -): DiagnosticFactory3DelegateProvider { + positioningStrategy: SourceElementPositioningStrategy = SourceElementPositioningStrategy.DEFAULT +): DiagnosticFactory3DelegateProvider { return DiagnosticFactory3DelegateProvider(Severity.WARNING, positioningStrategy, P::class) } inline fun error0( - positioningStrategy: SourceElementPositioningStrategy

= SourceElementPositioningStrategy.DEFAULT -): DiagnosticFactory0DelegateProvider

{ + positioningStrategy: SourceElementPositioningStrategy = SourceElementPositioningStrategy.DEFAULT +): DiagnosticFactory0DelegateProvider { return DiagnosticFactory0DelegateProvider(Severity.ERROR, positioningStrategy, P::class) } inline fun error1( - positioningStrategy: SourceElementPositioningStrategy

= SourceElementPositioningStrategy.DEFAULT -): DiagnosticFactory1DelegateProvider { + positioningStrategy: SourceElementPositioningStrategy = SourceElementPositioningStrategy.DEFAULT +): DiagnosticFactory1DelegateProvider { return DiagnosticFactory1DelegateProvider(Severity.ERROR, positioningStrategy, P::class) } inline fun error2( - positioningStrategy: SourceElementPositioningStrategy

= SourceElementPositioningStrategy.DEFAULT -): DiagnosticFactory2DelegateProvider { + positioningStrategy: SourceElementPositioningStrategy = SourceElementPositioningStrategy.DEFAULT +): DiagnosticFactory2DelegateProvider { return DiagnosticFactory2DelegateProvider(Severity.ERROR, positioningStrategy, P::class) } inline fun error3( - positioningStrategy: SourceElementPositioningStrategy

= SourceElementPositioningStrategy.DEFAULT -): DiagnosticFactory3DelegateProvider { + positioningStrategy: SourceElementPositioningStrategy = SourceElementPositioningStrategy.DEFAULT +): DiagnosticFactory3DelegateProvider { return DiagnosticFactory3DelegateProvider(Severity.ERROR, positioningStrategy, P::class) } inline fun error4( - positioningStrategy: SourceElementPositioningStrategy

= SourceElementPositioningStrategy.DEFAULT -): DiagnosticFactory4DelegateProvider { + positioningStrategy: SourceElementPositioningStrategy = SourceElementPositioningStrategy.DEFAULT +): DiagnosticFactory4DelegateProvider { return DiagnosticFactory4DelegateProvider(Severity.ERROR, positioningStrategy, P::class) } // ------------------------------ Providers ------------------------------ -class DiagnosticFactory0DelegateProvider

( +class DiagnosticFactory0DelegateProvider( private val severity: Severity, - private val positioningStrategy: SourceElementPositioningStrategy

, + private val positioningStrategy: SourceElementPositioningStrategy, private val psiType: KClass<*> ) { - operator fun provideDelegate(thisRef: Any?, prop: KProperty<*>): ReadOnlyProperty> { + operator fun provideDelegate(thisRef: Any?, prop: KProperty<*>): ReadOnlyProperty { return DummyDelegate(FirDiagnosticFactory0(prop.name, severity, positioningStrategy, psiType)) } } -class DiagnosticFactory1DelegateProvider

( +class DiagnosticFactory1DelegateProvider( private val severity: Severity, - private val positioningStrategy: SourceElementPositioningStrategy

, + private val positioningStrategy: SourceElementPositioningStrategy, private val psiType: KClass<*> ) { - operator fun provideDelegate(thisRef: Any?, prop: KProperty<*>): ReadOnlyProperty> { + operator fun provideDelegate(thisRef: Any?, prop: KProperty<*>): ReadOnlyProperty> { return DummyDelegate(FirDiagnosticFactory1(prop.name, severity, positioningStrategy, psiType)) } } -class DiagnosticFactory2DelegateProvider

( +class DiagnosticFactory2DelegateProvider( private val severity: Severity, - private val positioningStrategy: SourceElementPositioningStrategy

, + private val positioningStrategy: SourceElementPositioningStrategy, private val psiType: KClass<*> ) { - operator fun provideDelegate(thisRef: Any?, prop: KProperty<*>): ReadOnlyProperty> { + operator fun provideDelegate(thisRef: Any?, prop: KProperty<*>): ReadOnlyProperty> { return DummyDelegate(FirDiagnosticFactory2(prop.name, severity, positioningStrategy, psiType)) } } -class DiagnosticFactory3DelegateProvider

( +class DiagnosticFactory3DelegateProvider( private val severity: Severity, - private val positioningStrategy: SourceElementPositioningStrategy

, + private val positioningStrategy: SourceElementPositioningStrategy, private val psiType: KClass<*> ) { - operator fun provideDelegate(thisRef: Any?, prop: KProperty<*>): ReadOnlyProperty> { + operator fun provideDelegate(thisRef: Any?, prop: KProperty<*>): ReadOnlyProperty> { return DummyDelegate(FirDiagnosticFactory3(prop.name, severity, positioningStrategy, psiType)) } } -class DiagnosticFactory4DelegateProvider

( +class DiagnosticFactory4DelegateProvider( private val severity: Severity, - private val positioningStrategy: SourceElementPositioningStrategy

, + private val positioningStrategy: SourceElementPositioningStrategy, private val psiType: KClass<*> ) { - operator fun provideDelegate(thisRef: Any?, prop: KProperty<*>): ReadOnlyProperty> { + operator fun provideDelegate(thisRef: Any?, prop: KProperty<*>): ReadOnlyProperty> { return DummyDelegate(FirDiagnosticFactory4(prop.name, severity, positioningStrategy, psiType)) } } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticFactoryToRendererMap.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticFactoryToRendererMap.kt index ef9745a9908..1ca294c6282 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticFactoryToRendererMap.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticFactoryToRendererMap.kt @@ -8,16 +8,16 @@ package org.jetbrains.kotlin.fir.analysis.diagnostics import org.jetbrains.kotlin.diagnostics.rendering.DiagnosticParameterRenderer class FirDiagnosticFactoryToRendererMap(val name: String) { - private val renderersMap: MutableMap, FirDiagnosticRenderer<*>> = mutableMapOf() + private val renderersMap: MutableMap = mutableMapOf() - operator fun get(factory: AbstractFirDiagnosticFactory<*, *>): FirDiagnosticRenderer<*>? = renderersMap[factory] + operator fun get(factory: AbstractFirDiagnosticFactory): FirDiagnosticRenderer? = renderersMap[factory] - fun put(factory: FirDiagnosticFactory0<*>, message: String) { + fun put(factory: FirDiagnosticFactory0, message: String) { put(factory, SimpleFirDiagnosticRenderer(message)) } fun put( - factory: FirDiagnosticFactory1<*, A>, + factory: FirDiagnosticFactory1, message: String, rendererA: DiagnosticParameterRenderer? ) { @@ -25,7 +25,7 @@ class FirDiagnosticFactoryToRendererMap(val name: String) { } fun put( - factory: FirDiagnosticFactory2<*, A, B>, + factory: FirDiagnosticFactory2, message: String, rendererA: DiagnosticParameterRenderer?, rendererB: DiagnosticParameterRenderer? @@ -34,7 +34,7 @@ class FirDiagnosticFactoryToRendererMap(val name: String) { } fun put( - factory: FirDiagnosticFactory3<*, A, B, C>, + factory: FirDiagnosticFactory3, message: String, rendererA: DiagnosticParameterRenderer?, rendererB: DiagnosticParameterRenderer?, @@ -44,7 +44,7 @@ class FirDiagnosticFactoryToRendererMap(val name: String) { } fun put( - factory: FirDiagnosticFactory4<*, A, B, C, D>, + factory: FirDiagnosticFactory4, message: String, rendererA: DiagnosticParameterRenderer?, rendererB: DiagnosticParameterRenderer?, @@ -54,7 +54,7 @@ class FirDiagnosticFactoryToRendererMap(val name: String) { put(factory, FirDiagnosticWithParameters4Renderer(message, rendererA, rendererB, rendererC, rendererD)) } - private fun put(factory: AbstractFirDiagnosticFactory<*, *>, renderer: FirDiagnosticRenderer<*>) { + private fun put(factory: AbstractFirDiagnosticFactory, renderer: FirDiagnosticRenderer) { renderersMap[factory] = renderer } } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderer.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderer.kt index 0042c6a07b0..997a0789fd9 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderer.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderer.kt @@ -5,30 +5,34 @@ package org.jetbrains.kotlin.fir.analysis.diagnostics -import org.jetbrains.kotlin.diagnostics.rendering.* +import org.jetbrains.kotlin.diagnostics.rendering.DiagnosticParameterRenderer +import org.jetbrains.kotlin.diagnostics.rendering.RenderingContext +import org.jetbrains.kotlin.diagnostics.rendering.renderParameter import java.text.MessageFormat -sealed interface FirDiagnosticRenderer> { - fun render(diagnostic: D): String - fun renderParameters(diagnostic: D): Array +sealed interface FirDiagnosticRenderer { + fun render(diagnostic: FirDiagnostic): String + fun renderParameters(diagnostic: FirDiagnostic): Array } -class SimpleFirDiagnosticRenderer(private val message: String) : FirDiagnosticRenderer> { - override fun render(diagnostic: FirSimpleDiagnostic<*>): String { +class SimpleFirDiagnosticRenderer(private val message: String) : FirDiagnosticRenderer { + override fun render(diagnostic: FirDiagnostic): String { + require(diagnostic is FirSimpleDiagnostic) return message } - override fun renderParameters(diagnostic: FirSimpleDiagnostic<*>): Array { + override fun renderParameters(diagnostic: FirDiagnostic): Array { + require(diagnostic is FirSimpleDiagnostic) return emptyArray() } } -sealed class AbstractFirDiagnosticWithParametersRenderer>( +sealed class AbstractFirDiagnosticWithParametersRenderer( protected val message: String -) : FirDiagnosticRenderer { +) : FirDiagnosticRenderer { private val messageFormat = MessageFormat(message) - final override fun render(diagnostic: D): String { + final override fun render(diagnostic: FirDiagnostic): String { return messageFormat.format(renderParameters(diagnostic)) } } @@ -36,10 +40,12 @@ sealed class AbstractFirDiagnosticWithParametersRenderer>( class FirDiagnosticWithParameters1Renderer( message: String, private val rendererForA: DiagnosticParameterRenderer?, -) : AbstractFirDiagnosticWithParametersRenderer>(message) { - override fun renderParameters(diagnostic: FirDiagnosticWithParameters1<*, A>): Array { +) : AbstractFirDiagnosticWithParametersRenderer(message) { + override fun renderParameters(diagnostic: FirDiagnostic): Array { + require(diagnostic is FirDiagnosticWithParameters1<*>) val context = RenderingContext.of(diagnostic.a) - return arrayOf(renderParameter(diagnostic.a, rendererForA, context)) + @Suppress("UNCHECKED_CAST") + return arrayOf(renderParameter(diagnostic.a as A, rendererForA, context)) } } @@ -47,12 +53,14 @@ class FirDiagnosticWithParameters2Renderer( message: String, private val rendererForA: DiagnosticParameterRenderer?, private val rendererForB: DiagnosticParameterRenderer?, -) : AbstractFirDiagnosticWithParametersRenderer>(message) { - override fun renderParameters(diagnostic: FirDiagnosticWithParameters2<*, A, B>): Array { +) : AbstractFirDiagnosticWithParametersRenderer(message) { + override fun renderParameters(diagnostic: FirDiagnostic): Array { + require(diagnostic is FirDiagnosticWithParameters2<*, *>) val context = RenderingContext.of(diagnostic.a, diagnostic.b) + @Suppress("UNCHECKED_CAST") return arrayOf( - renderParameter(diagnostic.a, rendererForA, context), - renderParameter(diagnostic.b, rendererForB, context), + renderParameter(diagnostic.a as A, rendererForA, context), + renderParameter(diagnostic.b as B, rendererForB, context), ) } } @@ -62,13 +70,15 @@ class FirDiagnosticWithParameters3Renderer( private val rendererForA: DiagnosticParameterRenderer?, private val rendererForB: DiagnosticParameterRenderer?, private val rendererForC: DiagnosticParameterRenderer?, -) : AbstractFirDiagnosticWithParametersRenderer>(message) { - override fun renderParameters(diagnostic: FirDiagnosticWithParameters3<*, A, B, C>): Array { +) : AbstractFirDiagnosticWithParametersRenderer(message) { + override fun renderParameters(diagnostic: FirDiagnostic): Array { + require(diagnostic is FirDiagnosticWithParameters3<*, *, *>) val context = RenderingContext.of(diagnostic.a, diagnostic.b, diagnostic.c) + @Suppress("UNCHECKED_CAST") return arrayOf( - renderParameter(diagnostic.a, rendererForA, context), - renderParameter(diagnostic.b, rendererForB, context), - renderParameter(diagnostic.c, rendererForC, context), + renderParameter(diagnostic.a as A, rendererForA, context), + renderParameter(diagnostic.b as B, rendererForB, context), + renderParameter(diagnostic.c as C, rendererForC, context), ) } } @@ -79,14 +89,16 @@ class FirDiagnosticWithParameters4Renderer( private val rendererForB: DiagnosticParameterRenderer?, private val rendererForC: DiagnosticParameterRenderer?, private val rendererForD: DiagnosticParameterRenderer?, -) : AbstractFirDiagnosticWithParametersRenderer>(message) { - override fun renderParameters(diagnostic: FirDiagnosticWithParameters4<*, A, B, C, D>): Array { - val context = RenderingContext.of(diagnostic.a, diagnostic.b, diagnostic.c) +) : AbstractFirDiagnosticWithParametersRenderer(message) { + override fun renderParameters(diagnostic: FirDiagnostic): Array { + require(diagnostic is FirDiagnosticWithParameters4<*, *, *, *>) + val context = RenderingContext.of(diagnostic.a, diagnostic.b, diagnostic.c, diagnostic.d) + @Suppress("UNCHECKED_CAST") return arrayOf( - renderParameter(diagnostic.a, rendererForA, context), - renderParameter(diagnostic.b, rendererForB, context), - renderParameter(diagnostic.c, rendererForC, context), - renderParameter(diagnostic.d, rendererForD, context), + renderParameter(diagnostic.a as A, rendererForA, context), + renderParameter(diagnostic.b as B, rendererForB, context), + renderParameter(diagnostic.c as C, rendererForC, context), + renderParameter(diagnostic.d as D, rendererForD, context), ) } } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategy.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategy.kt index f628d09d93a..6448c8f2e6a 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategy.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategy.kt @@ -11,28 +11,38 @@ import org.jetbrains.kotlin.diagnostics.PositioningStrategy import org.jetbrains.kotlin.fir.FirPsiSourceElement import org.jetbrains.kotlin.fir.FirSourceElement -open class SourceElementPositioningStrategy( - val lightTreeStrategy: LightTreePositioningStrategy, - val psiStrategy: PositioningStrategy +class SourceElementPositioningStrategy( + private val lightTreeStrategy: LightTreePositioningStrategy, + private val psiStrategy: PositioningStrategy<*> ) { - fun markDiagnostic(diagnostic: FirDiagnostic<*>): List { + fun markDiagnostic(diagnostic: FirDiagnostic): List { val element = diagnostic.element - if (element is FirPsiSourceElement<*>) { + if (element is FirPsiSourceElement) { @Suppress("UNCHECKED_CAST") - return psiStrategy.mark(element.psi as E) + return psiStrategy.hackyMark(element.psi) } return lightTreeStrategy.mark(element.lighterASTNode, element.startOffset, element.endOffset, element.treeStructure) } fun isValid(element: FirSourceElement): Boolean { - if (element is FirPsiSourceElement<*>) { + if (element is FirPsiSourceElement) { @Suppress("UNCHECKED_CAST") - return psiStrategy.isValid(element.psi as E) + return psiStrategy.hackyIsValid(element.psi) } return lightTreeStrategy.isValid(element.lighterASTNode, element.treeStructure) } + private fun PositioningStrategy<*>.hackyMark(psi: PsiElement): List { + @Suppress("UNCHECKED_CAST") + return (this as PositioningStrategy).mark(psi) + } + + private fun PositioningStrategy<*>.hackyIsValid(psi: PsiElement): Boolean { + @Suppress("UNCHECKED_CAST") + return (this as PositioningStrategy).isValid(psi) + } + companion object { - val DEFAULT: SourceElementPositioningStrategy = SourceElementPositioningStrategies.DEFAULT + val DEFAULT: SourceElementPositioningStrategy = SourceElementPositioningStrategies.DEFAULT } } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt index 3662734482c..9513c9c9cca 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt @@ -5,7 +5,6 @@ package org.jetbrains.kotlin.fir.analysis.diagnostics -import com.intellij.psi.PsiElement import org.jetbrains.kotlin.KtNodeTypes import org.jetbrains.kotlin.fir.FirFakeSourceElementKind import org.jetbrains.kotlin.fir.FirSourceElement @@ -36,7 +35,7 @@ import org.jetbrains.kotlin.utils.addToStdlib.safeAs private fun ConeDiagnostic.toFirDiagnostic( source: FirSourceElement, qualifiedAccessSource: FirSourceElement? -): FirDiagnostic? = when (this) { +): FirDiagnostic? = when (this) { is ConeUnresolvedReferenceError -> FirErrors.UNRESOLVED_REFERENCE.createOn(source, this.name?.asString() ?: "") is ConeUnresolvedSymbolError -> FirErrors.UNRESOLVED_REFERENCE.createOn(source, this.classId.asString()) is ConeUnresolvedNameError -> FirErrors.UNRESOLVED_REFERENCE.createOn(source, this.name.asString()) @@ -91,7 +90,7 @@ private fun ConeDiagnostic.toFirDiagnostic( fun ConeDiagnostic.toFirDiagnostics( source: FirSourceElement, qualifiedAccessSource: FirSourceElement? -): List> { +): List { return when (this) { is ConeInapplicableCandidateError -> mapInapplicableCandidateError(this, source, qualifiedAccessSource) is ConeConstraintSystemHasContradiction -> mapSystemHasContradictionError(this, source, qualifiedAccessSource) @@ -104,7 +103,7 @@ private fun mapUnsafeCallError( rootCause: UnsafeCall, source: FirSourceElement, qualifiedAccessSource: FirSourceElement?, -): FirDiagnostic<*>? { +): FirDiagnostic? { if (candidate.callInfo.isImplicitInvoke) { return FirErrors.UNSAFE_IMPLICIT_INVOKE_CALL.createOn(source, rootCause.actualType) } @@ -152,7 +151,7 @@ private fun mapInapplicableCandidateError( diagnostic: ConeInapplicableCandidateError, source: FirSourceElement, qualifiedAccessSource: FirSourceElement?, -): List> { +): List { val genericDiagnostic = FirErrors.INAPPLICABLE_CANDIDATE.createOn(source, diagnostic.candidate.symbol) val diagnostics = diagnostic.candidate.diagnostics.filter { it.applicability == diagnostic.applicability }.mapNotNull { rootCause -> when (rootCause) { @@ -207,9 +206,9 @@ private fun mapSystemHasContradictionError( diagnostic: ConeConstraintSystemHasContradiction, source: FirSourceElement, qualifiedAccessSource: FirSourceElement?, -): List> { +): List { val errorsToIgnore = mutableSetOf() - return buildList> { + return buildList { for (error in diagnostic.candidate.system.errors) { addIfNotNull( error.toDiagnostic( @@ -252,7 +251,7 @@ private fun ConstraintSystemError.toDiagnostic( typeContext: ConeTypeContext, errorsToIgnore: MutableSet, candidate: Candidate, -): FirDiagnostic? { +): FirDiagnostic? { return when (this) { is NewConstraintError -> { val position = position.from @@ -329,7 +328,7 @@ private fun ConstraintSystemError.toDiagnostic( private val NewConstraintError.lowerConeType: ConeKotlinType get() = lowerType as ConeKotlinType private val NewConstraintError.upperConeType: ConeKotlinType get() = upperType as ConeKotlinType -private fun ConeSimpleDiagnostic.getFactory(source: FirSourceElement): FirDiagnosticFactory0<*> { +private fun ConeSimpleDiagnostic.getFactory(source: FirSourceElement): FirDiagnosticFactory0 { @Suppress("UNCHECKED_CAST") return when (kind) { DiagnosticKind.Syntax -> FirErrors.SYNTAX @@ -375,35 +374,35 @@ private fun ConeSimpleDiagnostic.getFactory(source: FirSourceElement): FirDiagno } @OptIn(InternalDiagnosticFactoryMethod::class) -private fun

FirDiagnosticFactory0

.createOn( +private fun FirDiagnosticFactory0.createOn( element: FirSourceElement? -): FirSimpleDiagnostic<*>? { +): FirSimpleDiagnostic? { return element?.let { on(it, positioningStrategy = null) } } @OptIn(InternalDiagnosticFactoryMethod::class) -private fun

FirDiagnosticFactory1.createOn( +private fun FirDiagnosticFactory1.createOn( element: FirSourceElement?, a: A -): FirDiagnosticWithParameters1<*, A>? { +): FirDiagnosticWithParameters1? { return element?.let { on(it, a, positioningStrategy = null) } } @OptIn(InternalDiagnosticFactoryMethod::class) -private fun

FirDiagnosticFactory2.createOn( +private fun FirDiagnosticFactory2.createOn( element: FirSourceElement?, a: A, b: B -): FirDiagnosticWithParameters2<*, A, B>? { +): FirDiagnosticWithParameters2? { return element?.let { on(it, a, b, positioningStrategy = null) } } @OptIn(InternalDiagnosticFactoryMethod::class) -private fun

FirDiagnosticFactory3.createOn( +private fun FirDiagnosticFactory3.createOn( element: FirSourceElement?, a: A, b: B, c: C -): FirDiagnosticWithParameters3<*, A, B, C>? { +): FirDiagnosticWithParameters3? { return element?.let { on(it, a, b, c, positioningStrategy = null) } } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/impl/BaseDiagnosticReporter.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/impl/BaseDiagnosticReporter.kt index 63ceeb2da50..94486bdf220 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/impl/BaseDiagnosticReporter.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/impl/BaseDiagnosticReporter.kt @@ -9,5 +9,5 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnostic abstract class BaseDiagnosticReporter : DiagnosticReporter() { - abstract val diagnostics: List> + abstract val diagnostics: List } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/impl/DiagnosticReporterWithSuppress.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/impl/DiagnosticReporterWithSuppress.kt index c131d78ce85..bf9d7c2697e 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/impl/DiagnosticReporterWithSuppress.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/impl/DiagnosticReporterWithSuppress.kt @@ -9,11 +9,11 @@ import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnostic class DiagnosticReporterWithSuppress : BaseDiagnosticReporter() { - private val _diagnostics: MutableList> = mutableListOf() - override val diagnostics: List> + private val _diagnostics: MutableList = mutableListOf() + override val diagnostics: List get() = _diagnostics - override fun report(diagnostic: FirDiagnostic<*>?, context: CheckerContext) { + override fun report(diagnostic: FirDiagnostic?, context: CheckerContext) { if (diagnostic == null) return if (!context.isDiagnosticSuppressed(diagnostic)) { _diagnostics += diagnostic diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/impl/SimpleDiagnosticReporter.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/impl/SimpleDiagnosticReporter.kt index eb7af3a7aa6..41062349754 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/impl/SimpleDiagnosticReporter.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/impl/SimpleDiagnosticReporter.kt @@ -9,11 +9,11 @@ import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnostic class SimpleDiagnosticReporter : BaseDiagnosticReporter() { - private val _diagnostics: MutableList> = mutableListOf() - override val diagnostics: List> + private val _diagnostics: MutableList = mutableListOf() + override val diagnostics: List get() = _diagnostics - override fun report(diagnostic: FirDiagnostic<*>?, context: CheckerContext) { + override fun report(diagnostic: FirDiagnostic?, context: CheckerContext) { if (diagnostic == null) return _diagnostics += diagnostic } diff --git a/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/IncrementalPassThroughLookupTrackerComponent.kt b/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/IncrementalPassThroughLookupTrackerComponent.kt index af9ad242410..f57187caa70 100644 --- a/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/IncrementalPassThroughLookupTrackerComponent.kt +++ b/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/IncrementalPassThroughLookupTrackerComponent.kt @@ -26,7 +26,7 @@ class IncrementalPassThroughLookupTrackerComponent( val path = sourceToFilePathsCache.getOrPut(definedSource) { sourceToFilePath(definedSource) } - val position = if (requiresPosition && source != null && source is FirPsiSourceElement<*>) { + val position = if (requiresPosition && source != null && source is FirPsiSourceElement) { getLineAndColumnInPsiFile(source.psi.containingFile, source.psi.textRange).let { Position(it.line, it.column) } } else Position.NO_POSITION diff --git a/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/analysis/FirAnalyzerFacade.kt b/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/analysis/FirAnalyzerFacade.kt index 5fe0f93924b..5bdeaa8ef20 100644 --- a/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/analysis/FirAnalyzerFacade.kt +++ b/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/analysis/FirAnalyzerFacade.kt @@ -31,7 +31,7 @@ import java.io.File abstract class AbstractFirAnalyzerFacade { abstract val scopeSession: ScopeSession - abstract fun runCheckers(): Map>> + abstract fun runCheckers(): Map> abstract fun runResolution(): List @@ -50,7 +50,7 @@ class FirAnalyzerFacade( override val scopeSession: ScopeSession get() = _scopeSession!! - private var collectedDiagnostics: Map>>? = null + private var collectedDiagnostics: Map>? = null private fun buildRawFir() { if (firFiles != null) return @@ -82,7 +82,7 @@ class FirAnalyzerFacade( } @OptIn(ExperimentalStdlibApi::class) - override fun runCheckers(): Map>> { + override fun runCheckers(): Map> { if (_scopeSession == null) runResolution() if (collectedDiagnostics != null) return collectedDiagnostics!! val collector = FirDiagnosticsCollector.create(session, scopeSession) diff --git a/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/session/ComponentsContainers.kt b/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/session/ComponentsContainers.kt index ed99ffa5bcf..61fd1722ac4 100644 --- a/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/session/ComponentsContainers.kt +++ b/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/session/ComponentsContainers.kt @@ -72,7 +72,7 @@ fun FirSession.registerResolveComponents(lookupTracker: LookupTracker? = null) { register(FirNameConflictsTrackerComponent::class, FirNameConflictsTracker()) if (lookupTracker != null) { val firFileToPath: (FirSourceElement) -> String = { - val psiSource = (it as? FirPsiSourceElement<*>) ?: TODO("Not implemented for non-FirPsiSourceElement") + val psiSource = (it as? FirPsiSourceElement) ?: TODO("Not implemented for non-FirPsiSourceElement") ((psiSource.psi as? PsiFile) ?: psiSource.psi.containingFile).virtualFile.path } register( diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaSymbolProvider.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaSymbolProvider.kt index 1ad935654b8..7cad9f70deb 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaSymbolProvider.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaSymbolProvider.kt @@ -14,12 +14,16 @@ import org.jetbrains.kotlin.descriptors.EffectiveVisibility import org.jetbrains.kotlin.descriptors.Modality import org.jetbrains.kotlin.descriptors.Visibilities import org.jetbrains.kotlin.fir.* -import org.jetbrains.kotlin.fir.caches.* +import org.jetbrains.kotlin.fir.caches.createCache +import org.jetbrains.kotlin.fir.caches.firCachesFactory +import org.jetbrains.kotlin.fir.caches.getValue import org.jetbrains.kotlin.fir.declarations.* -import org.jetbrains.kotlin.fir.declarations.builder.* +import org.jetbrains.kotlin.fir.declarations.builder.FirTypeParameterBuilder +import org.jetbrains.kotlin.fir.declarations.builder.buildConstructedClassTypeParameterRef +import org.jetbrains.kotlin.fir.declarations.builder.buildEnumEntry +import org.jetbrains.kotlin.fir.declarations.builder.buildOuterClassTypeParameterRef import org.jetbrains.kotlin.fir.declarations.impl.FirResolvedDeclarationStatusImpl import org.jetbrains.kotlin.fir.expressions.FirExpression -import org.jetbrains.kotlin.fir.expressions.builder.* import org.jetbrains.kotlin.fir.java.declarations.* import org.jetbrains.kotlin.fir.resolve.constructType import org.jetbrains.kotlin.fir.resolve.defaultType @@ -549,7 +553,7 @@ class JavaSymbolProvider( } private fun buildConstructorForAnnotationClass( - classSource: FirFakeSourceElement<*>?, + classSource: FirFakeSourceElement?, constructorId: CallableId, ownerClassBuilder: FirJavaClassBuilder, valueParametersForAnnotationConstructor: ValueParametersForAnnotationConstructor diff --git a/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt b/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt index ad1298e5764..123eb9ccd78 100644 --- a/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt +++ b/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt @@ -38,7 +38,6 @@ import org.jetbrains.kotlin.fir.types.impl.FirTypeArgumentListImpl import org.jetbrains.kotlin.fir.types.impl.FirTypePlaceholderProjection import org.jetbrains.kotlin.lexer.KtTokens.* import org.jetbrains.kotlin.name.CallableId -import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.psi.* import org.jetbrains.kotlin.psi.psiUtil.* @@ -79,7 +78,7 @@ open class RawFirBuilder( return reference.accept(Visitor(), Unit) as FirTypeRef } - override fun PsiElement.toFirSourceElement(kind: FirFakeSourceElementKind?): FirPsiSourceElement<*> { + override fun PsiElement.toFirSourceElement(kind: FirFakeSourceElementKind?): FirPsiSourceElement { val actualKind = kind ?: this@RawFirBuilder.context.forcedElementSourceKind ?: FirRealSourceElementKind return this.toFirPsiSourceElement(actualKind) } @@ -1988,7 +1987,7 @@ open class RawFirBuilder( private fun splitToCalleeAndReceiver( calleeExpression: KtExpression?, - defaultSource: FirPsiSourceElement<*>, + defaultSource: FirPsiSourceElement, ): CalleeAndReceiver { return when (calleeExpression) { is KtSimpleNameExpression -> diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirSourceElement.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirSourceElement.kt index 3217e74b7d5..de44d4e0083 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirSourceElement.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirSourceElement.kt @@ -187,7 +187,7 @@ sealed class FirSourceElement { // NB: in certain situations, psi.node could be null // Potentially exceptions can be provoked by elementType / lighterASTNode -sealed class FirPsiSourceElement(val psi: P) : FirSourceElement() { +sealed class FirPsiSourceElement(val psi: PsiElement) : FirSourceElement() { override val elementType: IElementType get() = psi.node.elementType @@ -268,23 +268,23 @@ sealed class FirPsiSourceElement(val psi: P) : FirSourceElem } } -class FirRealPsiSourceElement(psi: P) : FirPsiSourceElement

(psi) { +class FirRealPsiSourceElement(psi: PsiElement) : FirPsiSourceElement(psi) { override val kind: FirSourceElementKind get() = FirRealSourceElementKind } -class FirFakeSourceElement(psi: P, override val kind: FirFakeSourceElementKind) : FirPsiSourceElement

(psi) +class FirFakeSourceElement(psi: PsiElement, override val kind: FirFakeSourceElementKind) : FirPsiSourceElement(psi) fun FirSourceElement.fakeElement(newKind: FirFakeSourceElementKind): FirSourceElement { return when (this) { is FirLightSourceElement -> FirLightSourceElement(lighterASTNode, startOffset, endOffset, treeStructure, newKind) - is FirPsiSourceElement<*> -> FirFakeSourceElement(psi, newKind) + is FirPsiSourceElement -> FirFakeSourceElement(psi, newKind) } } fun FirSourceElement.realElement(): FirSourceElement = when (this) { - is FirRealPsiSourceElement<*> -> this + is FirRealPsiSourceElement -> this is FirLightSourceElement -> FirLightSourceElement(lighterASTNode, startOffset, endOffset, treeStructure, FirRealSourceElementKind) - is FirPsiSourceElement<*> -> FirRealPsiSourceElement(psi) + is FirPsiSourceElement -> FirRealPsiSourceElement(psi) } @@ -305,27 +305,27 @@ class FirLightSourceElement( * If it is `pure` [FirLightSourceElement], i.e, compiler created it in light tree mode, then return [unwrapToFirPsiSourceElement] `null`. * Otherwise, return some not-null result. */ - fun unwrapToFirPsiSourceElement(): FirPsiSourceElement<*>? { + fun unwrapToFirPsiSourceElement(): FirPsiSourceElement? { if (treeStructure !is FirPsiSourceElement.WrappedTreeStructure) return null val node = treeStructure.unwrap(lighterASTNode) return node.psi?.toFirPsiSourceElement(kind) } } -val FirSourceElement?.psi: PsiElement? get() = (this as? FirPsiSourceElement<*>)?.psi +val FirSourceElement?.psi: PsiElement? get() = (this as? FirPsiSourceElement)?.psi val FirSourceElement?.text: CharSequence? get() = when (this) { - is FirPsiSourceElement<*> -> psi.text + is FirPsiSourceElement -> psi.text is FirLightSourceElement -> treeStructure.toString(lighterASTNode) else -> null } -val FirElement.psi: PsiElement? get() = (source as? FirPsiSourceElement<*>)?.psi -val FirElement.realPsi: PsiElement? get() = (source as? FirRealPsiSourceElement<*>)?.psi +val FirElement.psi: PsiElement? get() = (source as? FirPsiSourceElement)?.psi +val FirElement.realPsi: PsiElement? get() = (source as? FirRealPsiSourceElement)?.psi @Suppress("NOTHING_TO_INLINE") -inline fun PsiElement.toFirPsiSourceElement(kind: FirSourceElementKind = FirRealSourceElementKind): FirPsiSourceElement<*> = when (kind) { +inline fun PsiElement.toFirPsiSourceElement(kind: FirSourceElementKind = FirRealSourceElementKind): FirPsiSourceElement = when (kind) { is FirRealSourceElementKind -> FirRealPsiSourceElement(this) is FirFakeSourceElementKind -> FirFakeSourceElement(this, kind) } diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/Utils.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/Utils.kt index 7e407939201..2bbd33dd2e5 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/Utils.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/Utils.kt @@ -68,7 +68,7 @@ fun R.copyWithNewSourceKind(newKind: FirFakeSourceElementKind): fun FirSourceElement.getWholeQualifierSourceIfPossible(stepsToWholeQualifier: Int): FirSourceElement { if (stepsToWholeQualifier == 0) return this return when (this) { - is FirRealPsiSourceElement<*> -> { + is FirRealPsiSourceElement -> { val qualifiersChain = generateSequence(psi) { it.parent } val wholeQualifier = qualifiersChain.elementAt(stepsToWholeQualifier) wholeQualifier.toFirPsiSourceElement() as FirRealPsiSourceElement @@ -82,7 +82,7 @@ fun FirSourceElement.getWholeQualifierSourceIfPossible(stepsToWholeQualifier: In endOffset = wholeQualifier.endOffset + (this.endOffset - this.lighterASTNode.endOffset) ) } - is FirFakeSourceElement<*> -> { + is FirFakeSourceElement -> { this } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/RenderingContext.kt b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/RenderingContext.kt index aa726637803..0cddb16865b 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/RenderingContext.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/RenderingContext.kt @@ -53,6 +53,7 @@ sealed class RenderingContext { is DiagnosticWithParameters1<*, *> -> listOf(d.a) is DiagnosticWithParameters2<*, *, *> -> listOf(d.a, d.b) is DiagnosticWithParameters3<*, *, *, *> -> listOf(d.a, d.b, d.c) + is DiagnosticWithParameters4<*, *, *, *, *> -> listOf(d.a, d.b, d.c, d.d) is ParametrizedDiagnostic<*> -> error("Unexpected diagnostic: ${d::class.java}") else -> listOf() } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/NoFirCompilationErrorsHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/NoFirCompilationErrorsHandler.kt index a25be5c8fd7..e3c951c5384 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/NoFirCompilationErrorsHandler.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/NoFirCompilationErrorsHandler.kt @@ -7,11 +7,7 @@ package org.jetbrains.kotlin.test.backend.handlers import org.jetbrains.kotlin.diagnostics.PsiDiagnosticUtils import org.jetbrains.kotlin.diagnostics.Severity -import org.jetbrains.kotlin.diagnostics.rendering.DefaultErrorMessages -import org.jetbrains.kotlin.fir.FirSourceElement import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDefaultErrorMessages -import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnostic -import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderer import org.jetbrains.kotlin.fir.psi import org.jetbrains.kotlin.test.directives.CodegenTestDirectives import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.IGNORE_FIR_DIAGNOSTICS @@ -33,7 +29,7 @@ class NoFirCompilationErrorsHandler(testServices: TestServices) : FirAnalysisHan if (diagnostic.severity == Severity.ERROR) { hasError = true if (!ignoreErrors) { - val diagnosticText = FirDefaultErrorMessages.getRendererForDiagnostic(diagnostic).hackyRender(diagnostic) + val diagnosticText = FirDefaultErrorMessages.getRendererForDiagnostic(diagnostic).render(diagnostic) val range = diagnostic.textRanges.first() val locationText = firFile.source?.psi?.containingFile?.let { psiFile -> PsiDiagnosticUtils.atLocation(psiFile, range) @@ -48,12 +44,5 @@ class NoFirCompilationErrorsHandler(testServices: TestServices) : FirAnalysisHan } } - private fun FirDiagnosticRenderer<*>.hackyRender(diagnostic: FirDiagnostic<*>): String { - @Suppress("UNCHECKED_CAST") - val renderer = this as FirDiagnosticRenderer> - val castedDiagnostic = diagnostic as FirDiagnostic - return renderer.render(castedDiagnostic) - } - override fun processAfterAllModules(someAssertionWasFailed: Boolean) {} } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirDiagnosticCodeMetaInfo.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirDiagnosticCodeMetaInfo.kt index a36c37346d7..52d4c220594 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirDiagnosticCodeMetaInfo.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirDiagnosticCodeMetaInfo.kt @@ -18,7 +18,7 @@ object FirMetaInfoUtils { } class FirDiagnosticCodeMetaInfo( - val diagnostic: FirDiagnostic<*>, + val diagnostic: FirDiagnostic, renderConfiguration: FirDiagnosticCodeMetaRenderConfiguration ) : CodeMetaInfo { private val textRangeFromClassicDiagnostic: TextRange = run { @@ -67,7 +67,7 @@ class FirDiagnosticCodeMetaRenderConfiguration( @Suppress("UNCHECKED_CAST") val renderer = FirDefaultErrorMessages.getRendererForDiagnostic(diagnostic) - if (renderer is AbstractFirDiagnosticWithParametersRenderer<*>) { + if (renderer is AbstractFirDiagnosticWithParametersRenderer) { renderer.renderParameters(diagnostic).mapTo(params, Any?::toString) } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirDiagnosticsHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirDiagnosticsHandler.kt index 4909853d96f..f5b8a3727d4 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirDiagnosticsHandler.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirDiagnosticsHandler.kt @@ -42,7 +42,6 @@ import org.jetbrains.kotlin.test.model.TestFile import org.jetbrains.kotlin.test.model.TestModule import org.jetbrains.kotlin.test.services.* import org.jetbrains.kotlin.test.utils.AbstractTwoAttributesMetaInfoProcessor -import org.jetbrains.kotlin.types.SmartcastStability import org.jetbrains.kotlin.util.OperatorNameConventions import org.jetbrains.kotlin.utils.addIfNotNull @@ -93,7 +92,7 @@ class FirDiagnosticsHandler(testServices: TestServices) : FirAnalysisHandler(tes } } - private fun FirDiagnostic<*>.toMetaInfo( + private fun FirDiagnostic.toMetaInfo( file: TestFile, lightTreeEnabled: Boolean, lightTreeComparingModeEnabled: Boolean, @@ -139,7 +138,7 @@ class FirDiagnosticsHandler(testServices: TestServices) : FirAnalysisHandler(tes lightTreeEnabled: Boolean, lightTreeComparingModeEnabled: Boolean ) { - val result = mutableListOf>() + val result = mutableListOf() val diagnosedRangesToDiagnosticNames = globalMetadataInfoHandler.getExistingMetaInfosForFile(testFile).groupBy( keySelector = { it.start..it.end }, valueTransform = { it.tag } @@ -177,7 +176,7 @@ class FirDiagnosticsHandler(testServices: TestServices) : FirAnalysisHandler(tes fun createExpressionTypeDiagnosticIfExpected( element: FirExpression, diagnosedRangesToDiagnosticNames: Map> - ): FirDiagnosticWithParameters1? = + ): FirDiagnosticWithParameters1? = DebugInfoDiagnosticFactory1.EXPRESSION_TYPE.createDebugInfoDiagnostic(element, diagnosedRangesToDiagnosticNames) { element.typeRef.renderAsString((element as? FirExpressionWithSmartcast)?.takeIf { it.isStable }?.originalType) } @@ -194,7 +193,7 @@ class FirDiagnosticsHandler(testServices: TestServices) : FirAnalysisHandler(tes element: FirElement, reference: FirNamedReference, diagnosedRangesToDiagnosticNames: Map> - ): FirDiagnosticWithParameters1? = + ): FirDiagnosticWithParameters1? = DebugInfoDiagnosticFactory1.CALL.createDebugInfoDiagnostic(element, diagnosedRangesToDiagnosticNames) { val resolvedSymbol = (reference as? FirResolvedNamedReference)?.resolvedSymbol val fqName = resolvedSymbol?.fqNameUnsafe() @@ -205,7 +204,7 @@ class FirDiagnosticsHandler(testServices: TestServices) : FirAnalysisHandler(tes return if (this === DebugInfoDiagnosticFactory1.CALL && sourceElement.elementType == KtNodeTypes.DOT_QUALIFIED_EXPRESSION ) { - if (sourceElement is FirPsiSourceElement<*>) { + if (sourceElement is FirPsiSourceElement) { val psi = (sourceElement.psi as KtDotQualifiedExpression).selectorExpression psi?.let { FirRealPsiSourceElement(it) } ?: sourceElement } else { @@ -230,7 +229,7 @@ class FirDiagnosticsHandler(testServices: TestServices) : FirAnalysisHandler(tes element: FirElement, diagnosedRangesToDiagnosticNames: Map>, argument: () -> String, - ): FirDiagnosticWithParameters1? { + ): FirDiagnosticWithParameters1? { val sourceElement = element.source ?: return null if (sourceElement.kind !in allowedKindsForDebugInfo) return null @@ -245,9 +244,9 @@ class FirDiagnosticsHandler(testServices: TestServices) : FirAnalysisHandler(tes } val argumentText = argument() - val factory = FirDiagnosticFactory1(name, severity, SourceElementPositioningStrategy.DEFAULT, PsiElement::class) + val factory = FirDiagnosticFactory1(name, severity, SourceElementPositioningStrategy.DEFAULT, PsiElement::class) return when (positionedElement) { - is FirPsiSourceElement<*> -> FirPsiDiagnosticWithParameters1( + is FirPsiSourceElement -> FirPsiDiagnosticWithParameters1( positionedElement, argumentText, severity, diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirBaseDiagnosticsTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirBaseDiagnosticsTest.kt index e684a3f9b31..b4d2e583516 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirBaseDiagnosticsTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirBaseDiagnosticsTest.kt @@ -42,7 +42,6 @@ import org.jetbrains.kotlin.resolve.AnalyzingUtils import org.jetbrains.kotlin.resolve.PlatformDependentAnalyzerServices import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatformAnalyzerServices import java.io.File -import java.util.* abstract class AbstractFirBaseDiagnosticsTest : BaseDiagnosticsTest() { override fun analyzeAndCheck(testDataFile: File, files: List) { @@ -219,7 +218,7 @@ abstract class AbstractFirBaseDiagnosticsTest : BaseDiagnosticsTest() { } protected fun TestFile.getActualText( - firDiagnostics: Iterable>, + firDiagnostics: Iterable, actualText: StringBuilder ): Boolean { val ktFile = this.ktFile @@ -331,7 +330,7 @@ abstract class AbstractFirBaseDiagnosticsTest : BaseDiagnosticsTest() { return ok[0] } - private fun Iterable>.toActualDiagnostic(root: PsiElement): List { + private fun Iterable.toActualDiagnostic(root: PsiElement): List { val result = mutableListOf() filterIsInstance().mapTo(result) { ActualDiagnostic(it, null, true) diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirDiagnosticTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirDiagnosticTest.kt index 6ce76ed8d81..0aa1718b2cf 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirDiagnosticTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirDiagnosticTest.kt @@ -117,7 +117,7 @@ abstract class AbstractFirDiagnosticsTest : AbstractFirBaseDiagnosticsTest() { for (testFile in testFiles) { val firFile = firFiles.firstOrNull { it.psi == testFile.ktFile } if (firFile != null) { - val debugInfoDiagnostics: List> = + val debugInfoDiagnostics: List = collectDebugInfoDiagnostics(firFile, testFile.diagnosedRangesToDiagnosticNames) testFile.getActualText( diagnostics.getValue(firFile) + debugInfoDiagnostics, @@ -134,8 +134,8 @@ abstract class AbstractFirDiagnosticsTest : AbstractFirBaseDiagnosticsTest() { protected fun collectDebugInfoDiagnostics( firFile: FirFile, diagnosedRangesToDiagnosticNames: MutableMap> - ): List> { - val result = mutableListOf>() + ): List { + val result = mutableListOf() object : FirDefaultVisitorVoid() { @@ -166,7 +166,7 @@ abstract class AbstractFirDiagnosticsTest : AbstractFirBaseDiagnosticsTest() { fun createExpressionTypeDiagnosticIfExpected( element: FirExpression, diagnosedRangesToDiagnosticNames: MutableMap> - ): FirDiagnosticWithParameters1? = + ): FirDiagnosticWithParameters1? = DebugInfoDiagnosticFactory1.EXPRESSION_TYPE.createDebugInfoDiagnostic(element, diagnosedRangesToDiagnosticNames) { element.typeRef.renderAsString((element as? FirExpressionWithSmartcast)?.originalType) } @@ -183,7 +183,7 @@ abstract class AbstractFirDiagnosticsTest : AbstractFirBaseDiagnosticsTest() { element: FirElement, reference: FirNamedReference, diagnosedRangesToDiagnosticNames: MutableMap> - ): FirDiagnosticWithParameters1? = + ): FirDiagnosticWithParameters1? = DebugInfoDiagnosticFactory1.CALL.createDebugInfoDiagnostic(element, diagnosedRangesToDiagnosticNames) { val resolvedSymbol = (reference as? FirResolvedNamedReference)?.resolvedSymbol @@ -195,7 +195,7 @@ abstract class AbstractFirDiagnosticsTest : AbstractFirBaseDiagnosticsTest() { element: FirElement, diagnosedRangesToDiagnosticNames: MutableMap>, argument: () -> String, - ): FirDiagnosticWithParameters1? { + ): FirDiagnosticWithParameters1? { val sourceElement = element.source ?: return null val sourceKind = sourceElement.kind if (sourceKind !in allowedKindsForDebugInfo) { @@ -211,7 +211,7 @@ abstract class AbstractFirDiagnosticsTest : AbstractFirBaseDiagnosticsTest() { val argumentText = argument() return when (sourceElement) { - is FirPsiSourceElement<*> -> FirPsiDiagnosticWithParameters1( + is FirPsiSourceElement -> FirPsiDiagnosticWithParameters1( sourceElement, argumentText, severity, @@ -264,9 +264,9 @@ abstract class AbstractFirDiagnosticsTest : AbstractFirBaseDiagnosticsTest() { } - protected fun collectDiagnostics(firFiles: List): Map>> { + protected fun collectDiagnostics(firFiles: List): Map> { val collectors = mutableMapOf() - val result = mutableMapOf>>() + val result = mutableMapOf>() for (firFile in firFiles) { val session = firFile.moduleData.session val collector = collectors.computeIfAbsent(session) { createCollector(session) } diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/FirModuleResolveStateDepended.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/FirModuleResolveStateDepended.kt index bcf6a2ac210..2bbc33ae248 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/FirModuleResolveStateDepended.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/FirModuleResolveStateDepended.kt @@ -72,10 +72,10 @@ internal class FirModuleResolveStateDepended( return null } - override fun getDiagnostics(element: KtElement, filter: DiagnosticCheckerFilter): List> = + override fun getDiagnostics(element: KtElement, filter: DiagnosticCheckerFilter): List = TODO("Diagnostics are not implemented for depended state") - override fun collectDiagnosticsForFile(ktFile: KtFile, filter: DiagnosticCheckerFilter): Collection> = + override fun collectDiagnosticsForFile(ktFile: KtFile, filter: DiagnosticCheckerFilter): Collection = TODO("Diagnostics are not implemented for depended state") @OptIn(InternalForInline::class) @@ -89,4 +89,4 @@ internal class FirModuleResolveStateDepended( @OptIn(InternalForInline::class) override fun findSourceFirCompiledDeclaration(ktDeclaration: KtDeclaration) = originalState.findSourceFirDeclaration(ktDeclaration) -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/FirModuleResolveStateImpl.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/FirModuleResolveStateImpl.kt index 086c8f3d4a4..79312598d12 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/FirModuleResolveStateImpl.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/FirModuleResolveStateImpl.kt @@ -73,10 +73,10 @@ internal class FirModuleResolveStateImpl( override fun tryGetCachedFirFile(declaration: FirDeclaration, cache: ModuleFileCache): FirFile? = cache.getContainerFirFile(declaration) - override fun getDiagnostics(element: KtElement, filter: DiagnosticCheckerFilter): List> = + override fun getDiagnostics(element: KtElement, filter: DiagnosticCheckerFilter): List = diagnosticsCollector.getDiagnosticsFor(element, filter) - override fun collectDiagnosticsForFile(ktFile: KtFile, filter: DiagnosticCheckerFilter): Collection> = + override fun collectDiagnosticsForFile(ktFile: KtFile, filter: DiagnosticCheckerFilter): Collection = diagnosticsCollector.collectDiagnosticsForFile(ktFile, filter) @OptIn(InternalForInline::class) @@ -173,4 +173,4 @@ internal class FirModuleResolveStateImpl( ) return declaration } -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/api/FirModuleResolveState.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/api/FirModuleResolveState.kt index 66991ba030c..73911da2ce2 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/api/FirModuleResolveState.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/api/FirModuleResolveState.kt @@ -15,7 +15,10 @@ import org.jetbrains.kotlin.idea.fir.low.level.api.file.builder.ModuleFileCache import org.jetbrains.kotlin.idea.fir.low.level.api.lazy.resolve.ResolveType import org.jetbrains.kotlin.idea.fir.low.level.api.sessions.FirIdeSourcesSession import org.jetbrains.kotlin.idea.fir.low.level.api.util.getElementTextInContext -import org.jetbrains.kotlin.psi.* +import org.jetbrains.kotlin.psi.KtDeclaration +import org.jetbrains.kotlin.psi.KtElement +import org.jetbrains.kotlin.psi.KtFile +import org.jetbrains.kotlin.psi.KtLambdaExpression abstract class FirModuleResolveState { abstract val project: Project @@ -43,9 +46,9 @@ abstract class FirModuleResolveState { */ internal abstract fun tryGetCachedFirFile(declaration: FirDeclaration, cache: ModuleFileCache): FirFile? - internal abstract fun getDiagnostics(element: KtElement, filter: DiagnosticCheckerFilter): List> + internal abstract fun getDiagnostics(element: KtElement, filter: DiagnosticCheckerFilter): List - internal abstract fun collectDiagnosticsForFile(ktFile: KtFile, filter: DiagnosticCheckerFilter): Collection> + internal abstract fun collectDiagnosticsForFile(ktFile: KtFile, filter: DiagnosticCheckerFilter): Collection internal inline fun withLock(declaration: D, declarationLockType: DeclarationLockType, action: (D) -> R): R { val originalDeclaration = (declaration as? FirCallableDeclaration<*>)?.unwrapFakeOverrides() ?: declaration @@ -85,4 +88,4 @@ abstract class FirModuleResolveState { internal abstract fun resolveFirToPhase(declaration: D, toPhase: FirResolvePhase): D internal abstract fun resolveFirToResolveType(declaration: D, type: ResolveType): D -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/api/LowLevelFirApiFacade.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/api/LowLevelFirApiFacade.kt index 573c3d45c18..cd5a3745283 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/api/LowLevelFirApiFacade.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/api/LowLevelFirApiFacade.kt @@ -169,7 +169,7 @@ fun D.withFirDeclarationInWriteLock( * Returns a list of Diagnostics compiler finds for given [KtElement] * This operation could be performance affective because it create FIleStructureElement and resolve non-local declaration into BODY phase */ -fun KtElement.getDiagnostics(resolveState: FirModuleResolveState, filter: DiagnosticCheckerFilter): Collection> = +fun KtElement.getDiagnostics(resolveState: FirModuleResolveState, filter: DiagnosticCheckerFilter): Collection = resolveState.getDiagnostics(this, filter) /** @@ -179,7 +179,7 @@ fun KtElement.getDiagnostics(resolveState: FirModuleResolveState, filter: Diagno fun KtFile.collectDiagnosticsForFile( resolveState: FirModuleResolveState, filter: DiagnosticCheckerFilter -): Collection> = +): Collection = resolveState.collectDiagnosticsForFile(this, filter) /** diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/DiagnosticsCollector.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/DiagnosticsCollector.kt index 2d2b2b459ad..6fbcd91d96d 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/DiagnosticsCollector.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/DiagnosticsCollector.kt @@ -16,15 +16,15 @@ internal class DiagnosticsCollector( private val fileStructureCache: FileStructureCache, private val cache: ModuleFileCache, ) { - fun getDiagnosticsFor(element: KtElement, filter: DiagnosticCheckerFilter): List> { + fun getDiagnosticsFor(element: KtElement, filter: DiagnosticCheckerFilter): List { val fileStructure = fileStructureCache.getFileStructure(element.containingKtFile, cache) val structureElement = fileStructure.getStructureElementFor(element) val diagnostics = structureElement.diagnostics return diagnostics.diagnosticsFor(filter, element) } - fun collectDiagnosticsForFile(ktFile: KtFile, filter: DiagnosticCheckerFilter): Collection> { + fun collectDiagnosticsForFile(ktFile: KtFile, filter: DiagnosticCheckerFilter): Collection { val fileStructure = fileStructureCache.getFileStructure(ktFile, cache) return fileStructure.getAllDiagnosticsForFile(filter) } -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/FileStructureElementDiagnosticList.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/FileStructureElementDiagnosticList.kt index 6a6686016df..1ea22749140 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/FileStructureElementDiagnosticList.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/FileStructureElementDiagnosticList.kt @@ -9,9 +9,9 @@ import com.intellij.psi.PsiElement import org.jetbrains.kotlin.fir.analysis.diagnostics.FirPsiDiagnostic internal class FileStructureElementDiagnosticList( - private val map: Map>> + private val map: Map> ) { - fun diagnosticsFor(element: PsiElement): List> = map[element] ?: emptyList() + fun diagnosticsFor(element: PsiElement): List = map[element] ?: emptyList() - inline fun forEach(action: (List>) -> Unit) = map.values.forEach(action) -} \ No newline at end of file + inline fun forEach(action: (List) -> Unit) = map.values.forEach(action) +} diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/FileStructureElementDiagnostics.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/FileStructureElementDiagnostics.kt index f7f5e134e2b..bc9349695d2 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/FileStructureElementDiagnostics.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/FileStructureElementDiagnostics.kt @@ -25,8 +25,8 @@ internal class FileStructureElementDiagnostics( retriever.retrieve(firFile, FileStructureElementDiagnosticsCollector.EXTENDED_COLLECTOR, lockProvider) } - fun diagnosticsFor(filter: DiagnosticCheckerFilter, element: PsiElement): List> = - SmartList>().apply { + fun diagnosticsFor(filter: DiagnosticCheckerFilter, element: PsiElement): List = + SmartList().apply { if (filter.runCommonCheckers) { addAll(diagnosticByCommonCheckers.diagnosticsFor(element)) } @@ -36,7 +36,7 @@ internal class FileStructureElementDiagnostics( } - inline fun forEach(filter: DiagnosticCheckerFilter, action: (List>) -> Unit) { + inline fun forEach(filter: DiagnosticCheckerFilter, action: (List) -> Unit) { if (filter.runCommonCheckers) { diagnosticByCommonCheckers.forEach(action) } @@ -44,4 +44,4 @@ internal class FileStructureElementDiagnostics( diagnosticByExtendedCheckers.forEach(action) } } -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/FirIdeDiagnosticReporter.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/FirIdeDiagnosticReporter.kt index c65cf75f0a6..36d83e2a8c6 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/FirIdeDiagnosticReporter.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostics/FirIdeDiagnosticReporter.kt @@ -11,14 +11,14 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.* import org.jetbrains.kotlin.idea.fir.low.level.api.util.addValueFor internal class FirIdeDiagnosticReporter : DiagnosticReporter() { - val diagnostics = mutableMapOf>>() + val diagnostics = mutableMapOf>() - override fun report(diagnostic: FirDiagnostic<*>?, context: CheckerContext) { + override fun report(diagnostic: FirDiagnostic?, context: CheckerContext) { if (diagnostic == null) return if (context.isDiagnosticSuppressed(diagnostic)) return val psiDiagnostic = when (diagnostic) { - is FirPsiDiagnostic<*> -> diagnostic + is FirPsiDiagnostic -> diagnostic is FirLightDiagnostic -> diagnostic.toPsiDiagnostic() else -> error("Unknown diagnostic type ${diagnostic::class.simpleName}") } @@ -26,7 +26,7 @@ internal class FirIdeDiagnosticReporter : DiagnosticReporter() { } } -private fun FirLightDiagnostic.toPsiDiagnostic(): FirPsiDiagnostic<*> { +private fun FirLightDiagnostic.toPsiDiagnostic(): FirPsiDiagnostic { val psiSourceElement = element.unwrapToFirPsiSourceElement() ?: error("Diagnostic should be created from PSI in IDE") @Suppress("UNCHECKED_CAST") @@ -34,7 +34,7 @@ private fun FirLightDiagnostic.toPsiDiagnostic(): FirPsiDiagnostic<*> { is FirLightSimpleDiagnostic -> FirPsiSimpleDiagnostic( psiSourceElement, severity, - factory as FirDiagnosticFactory0, + factory, positioningStrategy ) @@ -42,7 +42,7 @@ private fun FirLightDiagnostic.toPsiDiagnostic(): FirPsiDiagnostic<*> { psiSourceElement, a, severity, - factory as FirDiagnosticFactory1, + factory as FirDiagnosticFactory1, positioningStrategy ) @@ -50,7 +50,7 @@ private fun FirLightDiagnostic.toPsiDiagnostic(): FirPsiDiagnostic<*> { psiSourceElement, a, b, severity, - factory as FirDiagnosticFactory2, + factory as FirDiagnosticFactory2, positioningStrategy ) @@ -58,7 +58,7 @@ private fun FirLightDiagnostic.toPsiDiagnostic(): FirPsiDiagnostic<*> { psiSourceElement, a, b, c, severity, - factory as FirDiagnosticFactory3, + factory as FirDiagnosticFactory3, positioningStrategy ) @@ -66,7 +66,7 @@ private fun FirLightDiagnostic.toPsiDiagnostic(): FirPsiDiagnostic<*> { psiSourceElement, a, b, c, d, severity, - factory as FirDiagnosticFactory4, + factory as FirDiagnosticFactory4, positioningStrategy ) else -> error("Unknown diagnostic type ${this::class.simpleName}") diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/file/structure/FileStructure.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/file/structure/FileStructure.kt index 6e7b74c8d93..21cd122022d 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/file/structure/FileStructure.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/file/structure/FileStructure.kt @@ -70,7 +70,7 @@ internal class FileStructure private constructor( } @OptIn(ExperimentalStdlibApi::class) - fun getAllDiagnosticsForFile(diagnosticCheckerFilter: DiagnosticCheckerFilter): Collection> { + fun getAllDiagnosticsForFile(diagnosticCheckerFilter: DiagnosticCheckerFilter): Collection { val structureElements = getAllStructureElements() return buildList { @@ -78,7 +78,7 @@ internal class FileStructure private constructor( } } - private fun MutableCollection>.collectDiagnosticsFromStructureElements( + private fun MutableCollection.collectDiagnosticsFromStructureElements( structureElements: Collection, diagnosticCheckerFilter: DiagnosticCheckerFilter ) { diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/lazy/resolve/NonLocalDeclarationUtils.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/lazy/resolve/NonLocalDeclarationUtils.kt index 4796e702f43..2f4c9418009 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/lazy/resolve/NonLocalDeclarationUtils.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/lazy/resolve/NonLocalDeclarationUtils.kt @@ -25,7 +25,7 @@ internal fun FirDeclaration.getKtDeclarationForFirElement(): KtDeclaration { require(this !is FirFile) val ktDeclaration = (psi as? KtDeclaration) ?: run { - (source as? FirFakeSourceElement<*>).psi?.parentOfType() + (source as? FirFakeSourceElement).psi?.parentOfType() } check(ktDeclaration is KtDeclaration) { "FirDeclaration should have a PSI of type KtDeclaration" @@ -71,4 +71,4 @@ internal fun declarationCanBeLazilyResolved(declaration: KtDeclaration): Boolean is KtClassLikeDeclaration -> declaration.getClassId() != null else -> error("Unexpected ${declaration::class.qualifiedName}") } -} \ No newline at end of file +} diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/compiler/based/LowLevelFirAnalyzerFacade.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/compiler/based/LowLevelFirAnalyzerFacade.kt index 1dd3e291cfa..69dfdd83157 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/compiler/based/LowLevelFirAnalyzerFacade.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/compiler/based/LowLevelFirAnalyzerFacade.kt @@ -29,14 +29,13 @@ class LowLevelFirAnalyzerFacade( ) : AbstractFirAnalyzerFacade() { override val scopeSession: ScopeSession get() = shouldNotBeCalled() - override fun runCheckers(): Map>> { + override fun runCheckers(): Map> { findSealedInheritors() - return allFirFiles.values.associateWith { firFile -> val ktFile = firFile.psi as KtFile val diagnostics = ktFile.collectDiagnosticsForFile(resolveState, diagnosticCheckerFilter) @Suppress("UNCHECKED_CAST") - diagnostics.toList() as List> + diagnostics.toList() as List } } diff --git a/idea/idea-frontend-fir/idea-frontend-fir-generator/src/org/jetbrains/kotlin/idea/frontend/api/fir/generator/rendererrs/FirDiagnosticToKtDiagnosticConverterRenderer.kt b/idea/idea-frontend-fir/idea-frontend-fir-generator/src/org/jetbrains/kotlin/idea/frontend/api/fir/generator/rendererrs/FirDiagnosticToKtDiagnosticConverterRenderer.kt index 6072d043930..716d339bb3d 100644 --- a/idea/idea-frontend-fir/idea-frontend-fir-generator/src/org/jetbrains/kotlin/idea/frontend/api/fir/generator/rendererrs/FirDiagnosticToKtDiagnosticConverterRenderer.kt +++ b/idea/idea-frontend-fir/idea-frontend-fir-generator/src/org/jetbrains/kotlin/idea/frontend/api/fir/generator/rendererrs/FirDiagnosticToKtDiagnosticConverterRenderer.kt @@ -6,7 +6,10 @@ package org.jetbrains.kotlin.idea.frontend.api.fir.generator.rendererrs import org.jetbrains.kotlin.fir.checkers.generator.inBracketsWithIndent -import org.jetbrains.kotlin.idea.frontend.api.fir.generator.* +import org.jetbrains.kotlin.idea.frontend.api.fir.generator.ConversionContext +import org.jetbrains.kotlin.idea.frontend.api.fir.generator.HLDiagnostic +import org.jetbrains.kotlin.idea.frontend.api.fir.generator.HLDiagnosticList +import org.jetbrains.kotlin.idea.frontend.api.fir.generator.HLDiagnosticParameter import org.jetbrains.kotlin.util.SmartPrinter import org.jetbrains.kotlin.util.withIndent @@ -38,7 +41,7 @@ object FirDiagnosticToKtDiagnosticConverterRenderer : AbstractDiagnosticsDataCla private fun SmartPrinter.printDiagnosticParameters(diagnostic: HLDiagnostic) { printCustomParameters(diagnostic) - println("firDiagnostic as FirPsiDiagnostic<*>,") + println("firDiagnostic as FirPsiDiagnostic,") println("token,") } diff --git a/idea/idea-frontend-fir/idea-frontend-fir-generator/src/org/jetbrains/kotlin/idea/frontend/api/fir/generator/rendererrs/KtDiagnosticClassImplementationRenderer.kt b/idea/idea-frontend-fir/idea-frontend-fir-generator/src/org/jetbrains/kotlin/idea/frontend/api/fir/generator/rendererrs/KtDiagnosticClassImplementationRenderer.kt index f45ad4895c9..9d67b7920ee 100644 --- a/idea/idea-frontend-fir/idea-frontend-fir-generator/src/org/jetbrains/kotlin/idea/frontend/api/fir/generator/rendererrs/KtDiagnosticClassImplementationRenderer.kt +++ b/idea/idea-frontend-fir/idea-frontend-fir-generator/src/org/jetbrains/kotlin/idea/frontend/api/fir/generator/rendererrs/KtDiagnosticClassImplementationRenderer.kt @@ -5,10 +5,12 @@ package org.jetbrains.kotlin.idea.frontend.api.fir.generator.rendererrs -import org.jetbrains.kotlin.fir.checkers.generator.inBracketsWithIndent -import org.jetbrains.kotlin.idea.frontend.api.fir.generator.* -import org.jetbrains.kotlin.idea.frontend.api.fir.generator.printTypeWithShortNames import org.jetbrains.kotlin.fir.checkers.generator.collectClassNamesTo +import org.jetbrains.kotlin.fir.checkers.generator.inBracketsWithIndent +import org.jetbrains.kotlin.idea.frontend.api.fir.generator.HLDiagnostic +import org.jetbrains.kotlin.idea.frontend.api.fir.generator.HLDiagnosticList +import org.jetbrains.kotlin.idea.frontend.api.fir.generator.HLDiagnosticParameter +import org.jetbrains.kotlin.idea.frontend.api.fir.generator.printTypeWithShortNames import org.jetbrains.kotlin.util.SmartPrinter import org.jetbrains.kotlin.util.withIndent @@ -34,7 +36,7 @@ object KtDiagnosticClassImplementationRenderer : AbstractDiagnosticsDataClassRen printTypeWithShortNames(diagnostic.original.psiType) print(">") inBracketsWithIndent { - println("override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic)") + println("override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)") } } @@ -42,7 +44,7 @@ object KtDiagnosticClassImplementationRenderer : AbstractDiagnosticsDataClassRen for (parameter in diagnostic.parameters) { printParameter(parameter) } - println("firDiagnostic: FirPsiDiagnostic<*>,") + println("firDiagnostic: FirPsiDiagnostic,") println("override val token: ValidityToken,") } diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/fir/FirIdeDeserializedDeclarationSourceProvider.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/fir/FirIdeDeserializedDeclarationSourceProvider.kt index cd0464a4517..d81facf0af6 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/fir/FirIdeDeserializedDeclarationSourceProvider.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/fir/FirIdeDeserializedDeclarationSourceProvider.kt @@ -134,8 +134,8 @@ private val allowedFakeElementKinds = setOf( private fun FirElement.getAllowedPsi() = when (val source = source) { null -> null - is FirRealPsiSourceElement<*> -> source.psi - is FirFakeSourceElement<*> -> if (source.kind in allowedFakeElementKinds) psi else null + is FirRealPsiSourceElement -> source.psi + is FirFakeSourceElement -> if (source.kind in allowedFakeElementKinds) psi else null else -> null } diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/components/KtFirAnalysisSessionComponent.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/components/KtFirAnalysisSessionComponent.kt index 4e7ab59bee6..a59a96e917f 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/components/KtFirAnalysisSessionComponent.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/components/KtFirAnalysisSessionComponent.kt @@ -40,12 +40,12 @@ internal interface KtFirAnalysisSessionComponent { fun ConeKotlinType.asPsiType(mode: TypeMappingMode, psiContext: PsiElement) = asPsiType(rootModuleSession, analysisSession.firResolveState, mode, psiContext) - fun FirPsiDiagnostic<*>.asKtDiagnostic(): KtDiagnosticWithPsi<*> = - KT_DIAGNOSTIC_CONVERTER.convert(analysisSession, this as FirDiagnostic<*>) + fun FirPsiDiagnostic.asKtDiagnostic(): KtDiagnosticWithPsi<*> = + KT_DIAGNOSTIC_CONVERTER.convert(analysisSession, this as FirDiagnostic) fun ConeDiagnostic.asKtDiagnostic(source: FirSourceElement, qualifiedAccessSource: FirSourceElement?): KtDiagnosticWithPsi<*>? { val firDiagnostic = toFirDiagnostics(source, qualifiedAccessSource).firstOrNull() ?: return null - check(firDiagnostic is FirPsiDiagnostic<*>) + check(firDiagnostic is FirPsiDiagnostic) return firDiagnostic.asKtDiagnostic() } diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtAbstractFirDiagnostic.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtAbstractFirDiagnostic.kt index 7b52e7fb501..bf807d48ac3 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtAbstractFirDiagnostic.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtAbstractFirDiagnostic.kt @@ -10,24 +10,20 @@ import com.intellij.psi.PsiElement import org.jetbrains.kotlin.diagnostics.Severity import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDefaultErrorMessages import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnostic -import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderer import org.jetbrains.kotlin.fir.analysis.diagnostics.FirPsiDiagnostic -import org.jetbrains.kotlin.idea.frontend.api.diagnostics.KtDiagnostic import org.jetbrains.kotlin.idea.frontend.api.diagnostics.KtDiagnosticWithPsi internal interface KtAbstractFirDiagnostic : KtDiagnosticWithPsi { - val firDiagnostic: FirPsiDiagnostic<*> + val firDiagnostic: FirPsiDiagnostic override val factoryName: String get() = firDiagnostic.factory.name override val defaultMessage: String get() { - val diagnostic = firDiagnostic as FirDiagnostic<*> + val diagnostic = firDiagnostic as FirDiagnostic - @Suppress("UNCHECKED_CAST") - val firDiagnosticRenderer = - FirDefaultErrorMessages.getRendererForDiagnostic(diagnostic) as FirDiagnosticRenderer> + val firDiagnosticRenderer = FirDefaultErrorMessages.getRendererForDiagnostic(diagnostic) return firDiagnosticRenderer.render(diagnostic) } diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtDiagnosticConverter.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtDiagnosticConverter.kt index 8cb7917b176..462e1f8ac49 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtDiagnosticConverter.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtDiagnosticConverter.kt @@ -5,34 +5,33 @@ package org.jetbrains.kotlin.idea.frontend.api.fir.diagnostics -import org.jetbrains.kotlin.fir.FirSourceElement import org.jetbrains.kotlin.fir.analysis.diagnostics.* import org.jetbrains.kotlin.idea.frontend.api.fir.KtFirAnalysisSession internal interface KtFirDiagnosticCreator internal fun interface KtFirDiagnostic0Creator : KtFirDiagnosticCreator { - fun KtFirAnalysisSession.create(diagnostic: FirSimpleDiagnostic<*>): KtFirDiagnostic<*> + fun KtFirAnalysisSession.create(diagnostic: FirSimpleDiagnostic): KtFirDiagnostic<*> } internal fun interface KtFirDiagnostic1Creator : KtFirDiagnosticCreator { - fun KtFirAnalysisSession.create(diagnostic: FirDiagnosticWithParameters1<*, A>): KtFirDiagnostic<*> + fun KtFirAnalysisSession.create(diagnostic: FirDiagnosticWithParameters1): KtFirDiagnostic<*> } internal fun interface KtFirDiagnostic2Creator : KtFirDiagnosticCreator { - fun KtFirAnalysisSession.create(diagnostic: FirDiagnosticWithParameters2<*, A, B>): KtFirDiagnostic<*> + fun KtFirAnalysisSession.create(diagnostic: FirDiagnosticWithParameters2): KtFirDiagnostic<*> } internal fun interface KtFirDiagnostic3Creator : KtFirDiagnosticCreator { - fun KtFirAnalysisSession.create(diagnostic: FirDiagnosticWithParameters3<*, A, B, C>): KtFirDiagnostic<*> + fun KtFirAnalysisSession.create(diagnostic: FirDiagnosticWithParameters3): KtFirDiagnostic<*> } internal fun interface KtFirDiagnostic4Creator : KtFirDiagnosticCreator { - fun KtFirAnalysisSession.create(diagnostic: FirDiagnosticWithParameters4<*, A, B, C, D>): KtFirDiagnostic<*> + fun KtFirAnalysisSession.create(diagnostic: FirDiagnosticWithParameters4): KtFirDiagnostic<*> } -internal class KtDiagnosticConverter(private val conversions: Map, KtFirDiagnosticCreator>) { - fun convert(analysisSession: KtFirAnalysisSession, diagnostic: FirDiagnostic<*>): KtFirDiagnostic<*> { +internal class KtDiagnosticConverter(private val conversions: Map) { + fun convert(analysisSession: KtFirAnalysisSession, diagnostic: FirDiagnostic): KtFirDiagnostic<*> { val creator = conversions[diagnostic.factory] ?: error("No conversion was found for ${diagnostic.factory}") @@ -40,19 +39,19 @@ internal class KtDiagnosticConverter(private val conversions: Map with(creator) { - create(diagnostic as FirSimpleDiagnostic<*>) + create(diagnostic as FirSimpleDiagnostic) } is KtFirDiagnostic1Creator<*> -> with(creator as KtFirDiagnostic1Creator) { - create(diagnostic as FirDiagnosticWithParameters1) + create(diagnostic as FirDiagnosticWithParameters1) } is KtFirDiagnostic2Creator<*, *> -> with(creator as KtFirDiagnostic2Creator) { - create(diagnostic as FirDiagnosticWithParameters2) + create(diagnostic as FirDiagnosticWithParameters2) } is KtFirDiagnostic3Creator<*, *, *> -> with(creator as KtFirDiagnostic3Creator) { - create(diagnostic as FirDiagnosticWithParameters3) + create(diagnostic as FirDiagnosticWithParameters3) } is KtFirDiagnostic4Creator<*, *, *, *> -> with(creator as KtFirDiagnostic4Creator) { - create(diagnostic as FirDiagnosticWithParameters4) + create(diagnostic as FirDiagnosticWithParameters4) } else -> error("Invalid KtFirDiagnosticCreator ${creator::class.simpleName}") } @@ -61,25 +60,25 @@ internal class KtDiagnosticConverter(private val conversions: Map, KtFirDiagnosticCreator>() + private val conversions = mutableMapOf() - fun add(diagnostic: FirDiagnosticFactory0<*>, creator: KtFirDiagnostic0Creator) { + fun add(diagnostic: FirDiagnosticFactory0, creator: KtFirDiagnostic0Creator) { conversions[diagnostic] = creator } - fun add(diagnostic: FirDiagnosticFactory1<*, A>, creator: KtFirDiagnostic1Creator) { + fun add(diagnostic: FirDiagnosticFactory1, creator: KtFirDiagnostic1Creator) { conversions[diagnostic] = creator } - fun add(diagnostic: FirDiagnosticFactory2<*, A, B>, creator: KtFirDiagnostic2Creator) { + fun add(diagnostic: FirDiagnosticFactory2, creator: KtFirDiagnostic2Creator) { conversions[diagnostic] = creator } - fun add(diagnostic: FirDiagnosticFactory3<*, A, B, C>, creator: KtFirDiagnostic3Creator) { + fun add(diagnostic: FirDiagnosticFactory3, creator: KtFirDiagnostic3Creator) { conversions[diagnostic] = creator } - fun add(diagnostic: FirDiagnosticFactory4<*, A, B, C, D>, creator: KtFirDiagnostic4Creator) { + fun add(diagnostic: FirDiagnosticFactory4, creator: KtFirDiagnostic4Creator) { conversions[diagnostic] = creator } diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt index 6c9031c7c2c..6456deb569c 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt @@ -63,604 +63,604 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert add(FirErrors.UNSUPPORTED) { firDiagnostic -> UnsupportedImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.UNSUPPORTED_FEATURE) { firDiagnostic -> UnsupportedFeatureImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NEW_INFERENCE_ERROR) { firDiagnostic -> NewInferenceErrorImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.SYNTAX) { firDiagnostic -> SyntaxImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.OTHER_ERROR) { firDiagnostic -> OtherErrorImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ILLEGAL_CONST_EXPRESSION) { firDiagnostic -> IllegalConstExpressionImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ILLEGAL_UNDERSCORE) { firDiagnostic -> IllegalUnderscoreImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.EXPRESSION_EXPECTED) { firDiagnostic -> ExpressionExpectedImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ASSIGNMENT_IN_EXPRESSION_CONTEXT) { firDiagnostic -> AssignmentInExpressionContextImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.BREAK_OR_CONTINUE_OUTSIDE_A_LOOP) { firDiagnostic -> BreakOrContinueOutsideALoopImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NOT_A_LOOP_LABEL) { firDiagnostic -> NotALoopLabelImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.VARIABLE_EXPECTED) { firDiagnostic -> VariableExpectedImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.DELEGATION_IN_INTERFACE) { firDiagnostic -> DelegationInInterfaceImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NESTED_CLASS_NOT_ALLOWED) { firDiagnostic -> NestedClassNotAllowedImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INCORRECT_CHARACTER_LITERAL) { firDiagnostic -> IncorrectCharacterLiteralImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.EMPTY_CHARACTER_LITERAL) { firDiagnostic -> EmptyCharacterLiteralImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.TOO_MANY_CHARACTERS_IN_CHARACTER_LITERAL) { firDiagnostic -> TooManyCharactersInCharacterLiteralImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ILLEGAL_ESCAPE) { firDiagnostic -> IllegalEscapeImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INT_LITERAL_OUT_OF_RANGE) { firDiagnostic -> IntLiteralOutOfRangeImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.FLOAT_LITERAL_OUT_OF_RANGE) { firDiagnostic -> FloatLiteralOutOfRangeImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.WRONG_LONG_SUFFIX) { firDiagnostic -> WrongLongSuffixImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.DIVISION_BY_ZERO) { firDiagnostic -> DivisionByZeroImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.VAL_OR_VAR_ON_LOOP_PARAMETER) { firDiagnostic -> ValOrVarOnLoopParameterImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.VAL_OR_VAR_ON_FUN_PARAMETER) { firDiagnostic -> ValOrVarOnFunParameterImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.VAL_OR_VAR_ON_CATCH_PARAMETER) { firDiagnostic -> ValOrVarOnCatchParameterImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.VAL_OR_VAR_ON_SECONDARY_CONSTRUCTOR_PARAMETER) { firDiagnostic -> ValOrVarOnSecondaryConstructorParameterImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INVISIBLE_REFERENCE) { firDiagnostic -> InvisibleReferenceImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a.fir as FirDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.UNRESOLVED_REFERENCE) { firDiagnostic -> UnresolvedReferenceImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.UNRESOLVED_LABEL) { firDiagnostic -> UnresolvedLabelImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.DESERIALIZATION_ERROR) { firDiagnostic -> DeserializationErrorImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ERROR_FROM_JAVA_RESOLUTION) { firDiagnostic -> ErrorFromJavaResolutionImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.UNKNOWN_CALLABLE_KIND) { firDiagnostic -> UnknownCallableKindImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.MISSING_STDLIB_CLASS) { firDiagnostic -> MissingStdlibClassImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NO_THIS) { firDiagnostic -> NoThisImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS) { firDiagnostic -> CreatingAnInstanceOfAbstractClassImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.SUPER_IS_NOT_AN_EXPRESSION) { firDiagnostic -> SuperIsNotAnExpressionImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.SUPER_NOT_AVAILABLE) { firDiagnostic -> SuperNotAvailableImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ABSTRACT_SUPER_CALL) { firDiagnostic -> AbstractSuperCallImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INSTANCE_ACCESS_BEFORE_SUPER_CALL) { firDiagnostic -> InstanceAccessBeforeSuperCallImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ENUM_AS_SUPERTYPE) { firDiagnostic -> EnumAsSupertypeImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.RECURSION_IN_SUPERTYPES) { firDiagnostic -> RecursionInSupertypesImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NOT_A_SUPERTYPE) { firDiagnostic -> NotASupertypeImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.SUPERCLASS_NOT_ACCESSIBLE_FROM_INTERFACE) { firDiagnostic -> SuperclassNotAccessibleFromInterfaceImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.QUALIFIED_SUPERTYPE_EXTENDED_BY_OTHER_SUPERTYPE) { firDiagnostic -> QualifiedSupertypeExtendedByOtherSupertypeImpl( firSymbolBuilder.classifierBuilder.buildClassLikeSymbol(firDiagnostic.a), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.SUPERTYPE_INITIALIZED_IN_INTERFACE) { firDiagnostic -> SupertypeInitializedInInterfaceImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INTERFACE_WITH_SUPERCLASS) { firDiagnostic -> InterfaceWithSuperclassImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.FINAL_SUPERTYPE) { firDiagnostic -> FinalSupertypeImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.SUPERTYPE_IS_EXTENSION_FUNCTION_TYPE) { firDiagnostic -> SupertypeIsExtensionFunctionTypeImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.SINGLETON_IN_SUPERTYPE) { firDiagnostic -> SingletonInSupertypeImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NULLABLE_SUPERTYPE) { firDiagnostic -> NullableSupertypeImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.MANY_CLASSES_IN_SUPERTYPE_LIST) { firDiagnostic -> ManyClassesInSupertypeListImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.SUPERTYPE_APPEARS_TWICE) { firDiagnostic -> SupertypeAppearsTwiceImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CLASS_IN_SUPERTYPE_FOR_ENUM) { firDiagnostic -> ClassInSupertypeForEnumImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.SEALED_SUPERTYPE) { firDiagnostic -> SealedSupertypeImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.SEALED_SUPERTYPE_IN_LOCAL_CLASS) { firDiagnostic -> SealedSupertypeInLocalClassImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.SUPERTYPE_NOT_A_CLASS_OR_INTERFACE) { firDiagnostic -> SupertypeNotAClassOrInterfaceImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CYCLIC_INHERITANCE_HIERARCHY) { firDiagnostic -> CyclicInheritanceHierarchyImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CONSTRUCTOR_IN_OBJECT) { firDiagnostic -> ConstructorInObjectImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CONSTRUCTOR_IN_INTERFACE) { firDiagnostic -> ConstructorInInterfaceImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NON_PRIVATE_CONSTRUCTOR_IN_ENUM) { firDiagnostic -> NonPrivateConstructorInEnumImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NON_PRIVATE_OR_PROTECTED_CONSTRUCTOR_IN_SEALED) { firDiagnostic -> NonPrivateOrProtectedConstructorInSealedImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CYCLIC_CONSTRUCTOR_DELEGATION_CALL) { firDiagnostic -> CyclicConstructorDelegationCallImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED) { firDiagnostic -> PrimaryConstructorDelegationCallExpectedImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.SUPERTYPE_NOT_INITIALIZED) { firDiagnostic -> SupertypeNotInitializedImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR) { firDiagnostic -> SupertypeInitializedWithoutPrimaryConstructorImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.DELEGATION_SUPER_CALL_IN_ENUM_CONSTRUCTOR) { firDiagnostic -> DelegationSuperCallInEnumConstructorImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.PRIMARY_CONSTRUCTOR_REQUIRED_FOR_DATA_CLASS) { firDiagnostic -> PrimaryConstructorRequiredForDataClassImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.EXPLICIT_DELEGATION_CALL_REQUIRED) { firDiagnostic -> ExplicitDelegationCallRequiredImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.SEALED_CLASS_CONSTRUCTOR_CALL) { firDiagnostic -> SealedClassConstructorCallImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.DATA_CLASS_WITHOUT_PARAMETERS) { firDiagnostic -> DataClassWithoutParametersImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.DATA_CLASS_VARARG_PARAMETER) { firDiagnostic -> DataClassVarargParameterImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.DATA_CLASS_NOT_PROPERTY_PARAMETER) { firDiagnostic -> DataClassNotPropertyParameterImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ANNOTATION_ARGUMENT_KCLASS_LITERAL_OF_TYPE_PARAMETER_ERROR) { firDiagnostic -> AnnotationArgumentKclassLiteralOfTypeParameterErrorImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ANNOTATION_ARGUMENT_MUST_BE_CONST) { firDiagnostic -> AnnotationArgumentMustBeConstImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ANNOTATION_ARGUMENT_MUST_BE_ENUM_CONST) { firDiagnostic -> AnnotationArgumentMustBeEnumConstImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ANNOTATION_ARGUMENT_MUST_BE_KCLASS_LITERAL) { firDiagnostic -> AnnotationArgumentMustBeKclassLiteralImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ANNOTATION_CLASS_MEMBER) { firDiagnostic -> AnnotationClassMemberImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ANNOTATION_PARAMETER_DEFAULT_VALUE_MUST_BE_CONSTANT) { firDiagnostic -> AnnotationParameterDefaultValueMustBeConstantImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INVALID_TYPE_OF_ANNOTATION_MEMBER) { firDiagnostic -> InvalidTypeOfAnnotationMemberImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.LOCAL_ANNOTATION_CLASS_ERROR) { firDiagnostic -> LocalAnnotationClassErrorImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.MISSING_VAL_ON_ANNOTATION_PARAMETER) { firDiagnostic -> MissingValOnAnnotationParameterImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION) { firDiagnostic -> NonConstValUsedInConstantExpressionImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ANNOTATION_CLASS_CONSTRUCTOR_CALL) { firDiagnostic -> AnnotationClassConstructorCallImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NOT_AN_ANNOTATION_CLASS) { firDiagnostic -> NotAnAnnotationClassImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NULLABLE_TYPE_OF_ANNOTATION_MEMBER) { firDiagnostic -> NullableTypeOfAnnotationMemberImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.VAR_ANNOTATION_PARAMETER) { firDiagnostic -> VarAnnotationParameterImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.SUPERTYPES_FOR_ANNOTATION_CLASS) { firDiagnostic -> SupertypesForAnnotationClassImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ANNOTATION_USED_AS_ANNOTATION_ARGUMENT) { firDiagnostic -> AnnotationUsedAsAnnotationArgumentImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ILLEGAL_KOTLIN_VERSION_STRING_VALUE) { firDiagnostic -> IllegalKotlinVersionStringValueImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NEWER_VERSION_IN_SINCE_KOTLIN) { firDiagnostic -> NewerVersionInSinceKotlinImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.DEPRECATED_SINCE_KOTLIN_WITH_UNORDERED_VERSIONS) { firDiagnostic -> DeprecatedSinceKotlinWithUnorderedVersionsImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.DEPRECATED_SINCE_KOTLIN_WITHOUT_ARGUMENTS) { firDiagnostic -> DeprecatedSinceKotlinWithoutArgumentsImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.DEPRECATED_SINCE_KOTLIN_WITHOUT_DEPRECATED) { firDiagnostic -> DeprecatedSinceKotlinWithoutDeprecatedImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.DEPRECATED_SINCE_KOTLIN_WITH_DEPRECATED_LEVEL) { firDiagnostic -> DeprecatedSinceKotlinWithDeprecatedLevelImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.DEPRECATED_SINCE_KOTLIN_OUTSIDE_KOTLIN_SUBPACKAGE) { firDiagnostic -> DeprecatedSinceKotlinOutsideKotlinSubpackageImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ANNOTATION_ON_SUPERCLASS) { firDiagnostic -> AnnotationOnSuperclassImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.RESTRICTED_RETENTION_FOR_EXPRESSION_ANNOTATION) { firDiagnostic -> RestrictedRetentionForExpressionAnnotationImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.WRONG_ANNOTATION_TARGET) { firDiagnostic -> WrongAnnotationTargetImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -668,52 +668,52 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert WrongAnnotationTargetWithUseSiteTargetImpl( firDiagnostic.a, firDiagnostic.b, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INAPPLICABLE_TARGET_ON_PROPERTY) { firDiagnostic -> InapplicableTargetOnPropertyImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INAPPLICABLE_TARGET_PROPERTY_IMMUTABLE) { firDiagnostic -> InapplicableTargetPropertyImmutableImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INAPPLICABLE_TARGET_PROPERTY_HAS_NO_DELEGATE) { firDiagnostic -> InapplicableTargetPropertyHasNoDelegateImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INAPPLICABLE_TARGET_PROPERTY_HAS_NO_BACKING_FIELD) { firDiagnostic -> InapplicableTargetPropertyHasNoBackingFieldImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INAPPLICABLE_PARAM_TARGET) { firDiagnostic -> InapplicableParamTargetImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.REDUNDANT_ANNOTATION_TARGET) { firDiagnostic -> RedundantAnnotationTargetImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INAPPLICABLE_FILE_TARGET) { firDiagnostic -> InapplicableFileTargetImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -721,7 +721,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert ExperimentalApiUsageImpl( firDiagnostic.a, firDiagnostic.b, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -729,7 +729,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert ExperimentalApiUsageErrorImpl( firDiagnostic.a, firDiagnostic.b, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -737,7 +737,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert ExperimentalOverrideImpl( firDiagnostic.a, firDiagnostic.b, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -745,51 +745,51 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert ExperimentalOverrideErrorImpl( firDiagnostic.a, firDiagnostic.b, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.EXPERIMENTAL_IS_NOT_ENABLED) { firDiagnostic -> ExperimentalIsNotEnabledImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.EXPERIMENTAL_CAN_ONLY_BE_USED_AS_ANNOTATION) { firDiagnostic -> ExperimentalCanOnlyBeUsedAsAnnotationImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.EXPERIMENTAL_MARKER_CAN_ONLY_BE_USED_AS_ANNOTATION_OR_ARGUMENT_IN_USE_EXPERIMENTAL) { firDiagnostic -> ExperimentalMarkerCanOnlyBeUsedAsAnnotationOrArgumentInUseExperimentalImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.USE_EXPERIMENTAL_WITHOUT_ARGUMENTS) { firDiagnostic -> UseExperimentalWithoutArgumentsImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.USE_EXPERIMENTAL_ARGUMENT_IS_NOT_MARKER) { firDiagnostic -> UseExperimentalArgumentIsNotMarkerImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.EXPERIMENTAL_ANNOTATION_WITH_WRONG_TARGET) { firDiagnostic -> ExperimentalAnnotationWithWrongTargetImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.EXPERIMENTAL_ANNOTATION_WITH_WRONG_RETENTION) { firDiagnostic -> ExperimentalAnnotationWithWrongRetentionImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -798,7 +798,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a, firSymbolBuilder.buildSymbol(firDiagnostic.b as FirDeclaration), firDiagnostic.c, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -807,7 +807,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a, firSymbolBuilder.buildSymbol(firDiagnostic.b as FirDeclaration), firDiagnostic.c, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -816,7 +816,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a, firSymbolBuilder.buildSymbol(firDiagnostic.b as FirDeclaration), firDiagnostic.c, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -825,7 +825,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a, firSymbolBuilder.buildSymbol(firDiagnostic.b as FirDeclaration), firDiagnostic.c, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -834,7 +834,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a, firSymbolBuilder.buildSymbol(firDiagnostic.b as FirDeclaration), firDiagnostic.c, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -843,7 +843,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a, firSymbolBuilder.buildSymbol(firDiagnostic.b as FirDeclaration), firDiagnostic.c, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -852,7 +852,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a, firSymbolBuilder.buildSymbol(firDiagnostic.b as FirDeclaration), firDiagnostic.c, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -861,7 +861,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a, firSymbolBuilder.buildSymbol(firDiagnostic.b as FirDeclaration), firDiagnostic.c, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -870,20 +870,20 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a, firSymbolBuilder.buildSymbol(firDiagnostic.b as FirDeclaration), firDiagnostic.c, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INAPPLICABLE_INFIX_MODIFIER) { firDiagnostic -> InapplicableInfixModifierImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.REPEATED_MODIFIER) { firDiagnostic -> RepeatedModifierImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -891,7 +891,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert RedundantModifierImpl( firDiagnostic.a, firDiagnostic.b, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -899,7 +899,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert DeprecatedModifierPairImpl( firDiagnostic.a, firDiagnostic.b, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -907,13 +907,13 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert IncompatibleModifiersImpl( firDiagnostic.a, firDiagnostic.b, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.REDUNDANT_OPEN_IN_INTERFACE) { firDiagnostic -> RedundantOpenInInterfaceImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -921,7 +921,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert WrongModifierTargetImpl( firDiagnostic.a, firDiagnostic.b, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -929,106 +929,106 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert OperatorModifierRequiredImpl( firSymbolBuilder.functionLikeBuilder.buildFunctionSymbol(firDiagnostic.a.fir), firDiagnostic.b, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INFIX_MODIFIER_REQUIRED) { firDiagnostic -> InfixModifierRequiredImpl( firSymbolBuilder.functionLikeBuilder.buildFunctionSymbol(firDiagnostic.a.fir), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INLINE_CLASS_NOT_TOP_LEVEL) { firDiagnostic -> InlineClassNotTopLevelImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INLINE_CLASS_NOT_FINAL) { firDiagnostic -> InlineClassNotFinalImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ABSENCE_OF_PRIMARY_CONSTRUCTOR_FOR_INLINE_CLASS) { firDiagnostic -> AbsenceOfPrimaryConstructorForInlineClassImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INLINE_CLASS_CONSTRUCTOR_WRONG_PARAMETERS_SIZE) { firDiagnostic -> InlineClassConstructorWrongParametersSizeImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INLINE_CLASS_CONSTRUCTOR_NOT_FINAL_READ_ONLY_PARAMETER) { firDiagnostic -> InlineClassConstructorNotFinalReadOnlyParameterImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.PROPERTY_WITH_BACKING_FIELD_INSIDE_INLINE_CLASS) { firDiagnostic -> PropertyWithBackingFieldInsideInlineClassImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.DELEGATED_PROPERTY_INSIDE_INLINE_CLASS) { firDiagnostic -> DelegatedPropertyInsideInlineClassImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INLINE_CLASS_HAS_INAPPLICABLE_PARAMETER_TYPE) { firDiagnostic -> InlineClassHasInapplicableParameterTypeImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INLINE_CLASS_CANNOT_IMPLEMENT_INTERFACE_BY_DELEGATION) { firDiagnostic -> InlineClassCannotImplementInterfaceByDelegationImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INLINE_CLASS_CANNOT_EXTEND_CLASSES) { firDiagnostic -> InlineClassCannotExtendClassesImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INLINE_CLASS_CANNOT_BE_RECURSIVE) { firDiagnostic -> InlineClassCannotBeRecursiveImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.RESERVED_MEMBER_INSIDE_INLINE_CLASS) { firDiagnostic -> ReservedMemberInsideInlineClassImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_INLINE_CLASS) { firDiagnostic -> SecondaryConstructorWithBodyInsideInlineClassImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INNER_CLASS_INSIDE_INLINE_CLASS) { firDiagnostic -> InnerClassInsideInlineClassImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.VALUE_CLASS_CANNOT_BE_CLONEABLE) { firDiagnostic -> ValueClassCannotBeCloneableImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1037,14 +1037,14 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a.map { abstractFirBasedSymbol -> firSymbolBuilder.buildSymbol(abstractFirBasedSymbol.fir as FirDeclaration) }, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INAPPLICABLE_CANDIDATE) { firDiagnostic -> InapplicableCandidateImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a.fir as FirDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1052,21 +1052,21 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert TypeMismatchImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.THROWABLE_TYPE_MISMATCH) { firDiagnostic -> ThrowableTypeMismatchImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CONDITION_TYPE_MISMATCH) { firDiagnostic -> ConditionTypeMismatchImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1075,66 +1075,66 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b), firDiagnostic.c, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NULL_FOR_NONNULL_TYPE) { firDiagnostic -> NullForNonnullTypeImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INAPPLICABLE_LATEINIT_MODIFIER) { firDiagnostic -> InapplicableLateinitModifierImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.VARARG_OUTSIDE_PARENTHESES) { firDiagnostic -> VarargOutsideParenthesesImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NAMED_ARGUMENTS_NOT_ALLOWED) { firDiagnostic -> NamedArgumentsNotAllowedImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NON_VARARG_SPREAD) { firDiagnostic -> NonVarargSpreadImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ARGUMENT_PASSED_TWICE) { firDiagnostic -> ArgumentPassedTwiceImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.TOO_MANY_ARGUMENTS) { firDiagnostic -> TooManyArgumentsImpl( firSymbolBuilder.callableBuilder.buildCallableSymbol(firDiagnostic.a as FirCallableDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NO_VALUE_FOR_PARAMETER) { firDiagnostic -> NoValueForParameterImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NAMED_PARAMETER_NOT_FOUND) { firDiagnostic -> NamedParameterNotFoundImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1142,7 +1142,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert AssignmentTypeMismatchImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1150,20 +1150,20 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert ResultTypeMismatchImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.MANY_LAMBDA_EXPRESSION_ARGUMENTS) { firDiagnostic -> ManyLambdaExpressionArgumentsImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER) { firDiagnostic -> NewInferenceNoInformationForParameterImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1172,7 +1172,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a.map { abstractFirBasedSymbol -> firSymbolBuilder.buildSymbol(abstractFirBasedSymbol.fir as FirDeclaration) }, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1181,7 +1181,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a.map { abstractFirBasedSymbol -> firSymbolBuilder.buildSymbol(abstractFirBasedSymbol.fir as FirDeclaration) }, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1190,7 +1190,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a.map { abstractFirBasedSymbol -> firSymbolBuilder.buildSymbol(abstractFirBasedSymbol.fir as FirDeclaration) }, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1199,7 +1199,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a.map { abstractFirBasedSymbol -> firSymbolBuilder.buildSymbol(abstractFirBasedSymbol.fir as FirDeclaration) }, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1208,38 +1208,38 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a.map { abstractFirBasedSymbol -> firSymbolBuilder.buildSymbol(abstractFirBasedSymbol.fir as FirDeclaration) }, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.RECURSION_IN_IMPLICIT_TYPES) { firDiagnostic -> RecursionInImplicitTypesImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INFERENCE_ERROR) { firDiagnostic -> InferenceErrorImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT) { firDiagnostic -> ProjectionOnNonClassTypeArgumentImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.UPPER_BOUND_VIOLATED) { firDiagnostic -> UpperBoundViolatedImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.TYPE_ARGUMENTS_NOT_ALLOWED) { firDiagnostic -> TypeArgumentsNotAllowedImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1247,7 +1247,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert WrongNumberOfTypeArgumentsImpl( firDiagnostic.a, firSymbolBuilder.classifierBuilder.buildClassLikeSymbol(firDiagnostic.b.fir as FirClass<*>), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1255,134 +1255,134 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert NoTypeArgumentsOnRhsImpl( firDiagnostic.a, firSymbolBuilder.classifierBuilder.buildClassLikeSymbol(firDiagnostic.b.fir as FirClass<*>), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.TYPE_PARAMETERS_IN_OBJECT) { firDiagnostic -> TypeParametersInObjectImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ILLEGAL_PROJECTION_USAGE) { firDiagnostic -> IllegalProjectionUsageImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.TYPE_PARAMETERS_IN_ENUM) { firDiagnostic -> TypeParametersInEnumImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CONFLICTING_PROJECTION) { firDiagnostic -> ConflictingProjectionImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CONFLICTING_PROJECTION_IN_TYPEALIAS_EXPANSION) { firDiagnostic -> ConflictingProjectionInTypealiasExpansionImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.REDUNDANT_PROJECTION) { firDiagnostic -> RedundantProjectionImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED) { firDiagnostic -> VarianceOnTypeParameterNotAllowedImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CATCH_PARAMETER_WITH_DEFAULT_VALUE) { firDiagnostic -> CatchParameterWithDefaultValueImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.REIFIED_TYPE_IN_CATCH_CLAUSE) { firDiagnostic -> ReifiedTypeInCatchClauseImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.TYPE_PARAMETER_IN_CATCH_CLAUSE) { firDiagnostic -> TypeParameterInCatchClauseImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.GENERIC_THROWABLE_SUBCLASS) { firDiagnostic -> GenericThrowableSubclassImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INNER_CLASS_OF_GENERIC_THROWABLE_SUBCLASS) { firDiagnostic -> InnerClassOfGenericThrowableSubclassImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.KCLASS_WITH_NULLABLE_TYPE_PARAMETER_IN_SIGNATURE) { firDiagnostic -> KclassWithNullableTypeParameterInSignatureImpl( firSymbolBuilder.classifierBuilder.buildTypeParameterSymbol(firDiagnostic.a.fir), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.TYPE_PARAMETER_AS_REIFIED) { firDiagnostic -> TypeParameterAsReifiedImpl( firSymbolBuilder.classifierBuilder.buildTypeParameterSymbol(firDiagnostic.a.fir), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.FINAL_UPPER_BOUND) { firDiagnostic -> FinalUpperBoundImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.UPPER_BOUND_IS_EXTENSION_FUNCTION_TYPE) { firDiagnostic -> UpperBoundIsExtensionFunctionTypeImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.BOUNDS_NOT_ALLOWED_IF_BOUNDED_BY_TYPE_PARAMETER) { firDiagnostic -> BoundsNotAllowedIfBoundedByTypeParameterImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ONLY_ONE_CLASS_BOUND_ALLOWED) { firDiagnostic -> OnlyOneClassBoundAllowedImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.REPEATED_BOUND) { firDiagnostic -> RepeatedBoundImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CONFLICTING_UPPER_BOUNDS) { firDiagnostic -> ConflictingUpperBoundsImpl( firSymbolBuilder.classifierBuilder.buildTypeParameterSymbol(firDiagnostic.a.fir), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1390,31 +1390,31 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert NameInConstraintIsNotATypeParameterImpl( firDiagnostic.a, firSymbolBuilder.buildSymbol(firDiagnostic.b), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.BOUND_ON_TYPE_ALIAS_PARAMETER_NOT_ALLOWED) { firDiagnostic -> BoundOnTypeAliasParameterNotAllowedImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.REIFIED_TYPE_PARAMETER_NO_INLINE) { firDiagnostic -> ReifiedTypeParameterNoInlineImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.TYPE_PARAMETERS_NOT_ALLOWED) { firDiagnostic -> TypeParametersNotAllowedImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.TYPE_PARAMETER_OF_PROPERTY_NOT_USED_IN_RECEIVER) { firDiagnostic -> TypeParameterOfPropertyNotUsedInReceiverImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1423,31 +1423,31 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b), firSymbolBuilder.buildSymbol(firDiagnostic.c), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CYCLIC_GENERIC_UPPER_BOUND) { firDiagnostic -> CyclicGenericUpperBoundImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.DEPRECATED_TYPE_PARAMETER_SYNTAX) { firDiagnostic -> DeprecatedTypeParameterSyntaxImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.MISPLACED_TYPE_PARAMETER_CONSTRAINTS) { firDiagnostic -> MisplacedTypeParameterConstraintsImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.DYNAMIC_UPPER_BOUND) { firDiagnostic -> DynamicUpperBoundImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1455,7 +1455,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert IncompatibleTypesImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1463,7 +1463,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert IncompatibleTypesWarningImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1473,7 +1473,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.b, firDiagnostic.c, firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.d), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1483,7 +1483,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.b, firDiagnostic.c, firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.d), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1492,52 +1492,52 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), firDiagnostic.b.source!!.psi as KtExpression, firDiagnostic.c, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.EXTENSION_IN_CLASS_REFERENCE_NOT_ALLOWED) { firDiagnostic -> ExtensionInClassReferenceNotAllowedImpl( firSymbolBuilder.callableBuilder.buildCallableSymbol(firDiagnostic.a as FirCallableDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CALLABLE_REFERENCE_LHS_NOT_A_CLASS) { firDiagnostic -> CallableReferenceLhsNotAClassImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CALLABLE_REFERENCE_TO_ANNOTATION_CONSTRUCTOR) { firDiagnostic -> CallableReferenceToAnnotationConstructorImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CLASS_LITERAL_LHS_NOT_A_CLASS) { firDiagnostic -> ClassLiteralLhsNotAClassImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NULLABLE_TYPE_IN_CLASS_LITERAL_LHS) { firDiagnostic -> NullableTypeInClassLiteralLhsImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.EXPRESSION_OF_NULLABLE_TYPE_IN_CLASS_LITERAL_LHS) { firDiagnostic -> ExpressionOfNullableTypeInClassLiteralLhsImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NOTHING_TO_OVERRIDE) { firDiagnostic -> NothingToOverrideImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a as FirDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1546,7 +1546,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a, firSymbolBuilder.callableBuilder.buildCallableSymbol(firDiagnostic.b as FirCallableDeclaration), firDiagnostic.c, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1555,7 +1555,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a, firSymbolBuilder.callableBuilder.buildCallableSymbol(firDiagnostic.b as FirCallableDeclaration), firDiagnostic.c, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1563,7 +1563,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert OverridingFinalMemberImpl( firSymbolBuilder.callableBuilder.buildCallableSymbol(firDiagnostic.a as FirCallableDeclaration), firDiagnostic.b, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1571,7 +1571,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert AbstractMemberNotImplementedImpl( firSymbolBuilder.classifierBuilder.buildClassLikeSymbol(firDiagnostic.a), firSymbolBuilder.callableBuilder.buildCallableSymbol(firDiagnostic.b as FirCallableDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1579,7 +1579,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert AbstractClassMemberNotImplementedImpl( firSymbolBuilder.classifierBuilder.buildClassLikeSymbol(firDiagnostic.a), firSymbolBuilder.callableBuilder.buildCallableSymbol(firDiagnostic.b as FirCallableDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1587,7 +1587,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert InvisibleAbstractMemberFromSuperImpl( firSymbolBuilder.classifierBuilder.buildClassLikeSymbol(firDiagnostic.a), firSymbolBuilder.callableBuilder.buildCallableSymbol(firDiagnostic.b as FirCallableDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1595,7 +1595,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert InvisibleAbstractMemberFromSuperWarningImpl( firSymbolBuilder.classifierBuilder.buildClassLikeSymbol(firDiagnostic.a), firSymbolBuilder.callableBuilder.buildCallableSymbol(firDiagnostic.b as FirCallableDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1603,7 +1603,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert ManyImplMemberNotImplementedImpl( firSymbolBuilder.classifierBuilder.buildClassLikeSymbol(firDiagnostic.a), firSymbolBuilder.callableBuilder.buildCallableSymbol(firDiagnostic.b as FirCallableDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1611,7 +1611,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert ManyInterfacesMemberNotImplementedImpl( firSymbolBuilder.classifierBuilder.buildClassLikeSymbol(firDiagnostic.a), firSymbolBuilder.callableBuilder.buildCallableSymbol(firDiagnostic.b as FirCallableDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1619,7 +1619,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert OverridingFinalMemberByDelegationImpl( firSymbolBuilder.callableBuilder.buildCallableSymbol(firDiagnostic.a as FirCallableDeclaration), firSymbolBuilder.callableBuilder.buildCallableSymbol(firDiagnostic.b as FirCallableDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1627,7 +1627,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert DelegatedMemberHidesSupertypeOverrideImpl( firSymbolBuilder.callableBuilder.buildCallableSymbol(firDiagnostic.a as FirCallableDeclaration), firSymbolBuilder.callableBuilder.buildCallableSymbol(firDiagnostic.b as FirCallableDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1635,7 +1635,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert ReturnTypeMismatchOnOverrideImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a as FirDeclaration), firSymbolBuilder.buildSymbol(firDiagnostic.b as FirDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1643,7 +1643,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert PropertyTypeMismatchOnOverrideImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a as FirDeclaration), firSymbolBuilder.buildSymbol(firDiagnostic.b as FirDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1651,7 +1651,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert VarTypeMismatchOnOverrideImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a as FirDeclaration), firSymbolBuilder.buildSymbol(firDiagnostic.b as FirDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1659,19 +1659,19 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert VarOverriddenByValImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a as FirDeclaration), firSymbolBuilder.buildSymbol(firDiagnostic.b as FirDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NON_FINAL_MEMBER_IN_FINAL_CLASS) { firDiagnostic -> NonFinalMemberInFinalClassImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NON_FINAL_MEMBER_IN_OBJECT) { firDiagnostic -> NonFinalMemberInObjectImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1679,13 +1679,13 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert VirtualMemberHiddenImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a as FirDeclaration), firSymbolBuilder.classifierBuilder.buildClassLikeSymbol(firDiagnostic.b) as KtNamedClassOrObjectSymbol, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.MANY_COMPANION_OBJECTS) { firDiagnostic -> ManyCompanionObjectsImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1694,7 +1694,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a.map { abstractFirBasedSymbol -> firSymbolBuilder.buildSymbol(abstractFirBasedSymbol.fir as FirDeclaration) }, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1703,27 +1703,27 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a.map { abstractFirBasedSymbol -> firSymbolBuilder.buildSymbol(abstractFirBasedSymbol.fir as FirDeclaration) }, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.METHOD_OF_ANY_IMPLEMENTED_IN_INTERFACE) { firDiagnostic -> MethodOfAnyImplementedInInterfaceImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.LOCAL_OBJECT_NOT_ALLOWED) { firDiagnostic -> LocalObjectNotAllowedImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.LOCAL_INTERFACE_NOT_ALLOWED) { firDiagnostic -> LocalInterfaceNotAllowedImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1731,120 +1731,120 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert AbstractFunctionInNonAbstractClassImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a as FirDeclaration), firSymbolBuilder.classifierBuilder.buildClassLikeSymbol(firDiagnostic.b), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ABSTRACT_FUNCTION_WITH_BODY) { firDiagnostic -> AbstractFunctionWithBodyImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a as FirDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NON_ABSTRACT_FUNCTION_WITH_NO_BODY) { firDiagnostic -> NonAbstractFunctionWithNoBodyImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a as FirDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.PRIVATE_FUNCTION_WITH_NO_BODY) { firDiagnostic -> PrivateFunctionWithNoBodyImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a as FirDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NON_MEMBER_FUNCTION_NO_BODY) { firDiagnostic -> NonMemberFunctionNoBodyImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a as FirDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.FUNCTION_DECLARATION_WITH_NO_NAME) { firDiagnostic -> FunctionDeclarationWithNoNameImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ANONYMOUS_FUNCTION_WITH_NAME) { firDiagnostic -> AnonymousFunctionWithNameImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ANONYMOUS_FUNCTION_PARAMETER_WITH_DEFAULT_VALUE) { firDiagnostic -> AnonymousFunctionParameterWithDefaultValueImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.USELESS_VARARG_ON_PARAMETER) { firDiagnostic -> UselessVarargOnParameterImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.MULTIPLE_VARARG_PARAMETERS) { firDiagnostic -> MultipleVarargParametersImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.FORBIDDEN_VARARG_PARAMETER_TYPE) { firDiagnostic -> ForbiddenVarargParameterTypeImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.VALUE_PARAMETER_WITH_NO_TYPE_ANNOTATION) { firDiagnostic -> ValueParameterWithNoTypeAnnotationImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CANNOT_INFER_PARAMETER_TYPE) { firDiagnostic -> CannotInferParameterTypeImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.FUN_INTERFACE_CONSTRUCTOR_REFERENCE) { firDiagnostic -> FunInterfaceConstructorReferenceImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS) { firDiagnostic -> FunInterfaceWrongCountOfAbstractMembersImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.FUN_INTERFACE_CANNOT_HAVE_ABSTRACT_PROPERTIES) { firDiagnostic -> FunInterfaceCannotHaveAbstractPropertiesImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.FUN_INTERFACE_ABSTRACT_METHOD_WITH_TYPE_PARAMETERS) { firDiagnostic -> FunInterfaceAbstractMethodWithTypeParametersImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.FUN_INTERFACE_ABSTRACT_METHOD_WITH_DEFAULT_VALUE) { firDiagnostic -> FunInterfaceAbstractMethodWithDefaultValueImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.FUN_INTERFACE_WITH_SUSPEND_FUNCTION) { firDiagnostic -> FunInterfaceWithSuspendFunctionImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -1852,158 +1852,158 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert AbstractPropertyInNonAbstractClassImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a as FirDeclaration), firSymbolBuilder.classifierBuilder.buildClassLikeSymbol(firDiagnostic.b), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.PRIVATE_PROPERTY_IN_INTERFACE) { firDiagnostic -> PrivatePropertyInInterfaceImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ABSTRACT_PROPERTY_WITH_INITIALIZER) { firDiagnostic -> AbstractPropertyWithInitializerImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.PROPERTY_INITIALIZER_IN_INTERFACE) { firDiagnostic -> PropertyInitializerInInterfaceImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.PROPERTY_WITH_NO_TYPE_NO_INITIALIZER) { firDiagnostic -> PropertyWithNoTypeNoInitializerImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.MUST_BE_INITIALIZED) { firDiagnostic -> MustBeInitializedImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.MUST_BE_INITIALIZED_OR_BE_ABSTRACT) { firDiagnostic -> MustBeInitializedOrBeAbstractImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.EXTENSION_PROPERTY_MUST_HAVE_ACCESSORS_OR_BE_ABSTRACT) { firDiagnostic -> ExtensionPropertyMustHaveAccessorsOrBeAbstractImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.UNNECESSARY_LATEINIT) { firDiagnostic -> UnnecessaryLateinitImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.BACKING_FIELD_IN_INTERFACE) { firDiagnostic -> BackingFieldInInterfaceImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.EXTENSION_PROPERTY_WITH_BACKING_FIELD) { firDiagnostic -> ExtensionPropertyWithBackingFieldImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.PROPERTY_INITIALIZER_NO_BACKING_FIELD) { firDiagnostic -> PropertyInitializerNoBackingFieldImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ABSTRACT_DELEGATED_PROPERTY) { firDiagnostic -> AbstractDelegatedPropertyImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.DELEGATED_PROPERTY_IN_INTERFACE) { firDiagnostic -> DelegatedPropertyInInterfaceImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ABSTRACT_PROPERTY_WITH_GETTER) { firDiagnostic -> AbstractPropertyWithGetterImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ABSTRACT_PROPERTY_WITH_SETTER) { firDiagnostic -> AbstractPropertyWithSetterImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.PRIVATE_SETTER_FOR_ABSTRACT_PROPERTY) { firDiagnostic -> PrivateSetterForAbstractPropertyImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.PRIVATE_SETTER_FOR_OPEN_PROPERTY) { firDiagnostic -> PrivateSetterForOpenPropertyImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.EXPECTED_PRIVATE_DECLARATION) { firDiagnostic -> ExpectedPrivateDeclarationImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.VAL_WITH_SETTER) { firDiagnostic -> ValWithSetterImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT) { firDiagnostic -> ConstValNotTopLevelOrObjectImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CONST_VAL_WITH_GETTER) { firDiagnostic -> ConstValWithGetterImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CONST_VAL_WITH_DELEGATE) { firDiagnostic -> ConstValWithDelegateImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.TYPE_CANT_BE_USED_FOR_CONST_VAL) { firDiagnostic -> TypeCantBeUsedForConstValImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CONST_VAL_WITHOUT_INITIALIZER) { firDiagnostic -> ConstValWithoutInitializerImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CONST_VAL_WITH_NON_CONST_INITIALIZER) { firDiagnostic -> ConstValWithNonConstInitializerImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2011,7 +2011,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert WrongSetterParameterTypeImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2019,25 +2019,25 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert InitializerTypeMismatchImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.GETTER_VISIBILITY_DIFFERS_FROM_PROPERTY_VISIBILITY) { firDiagnostic -> GetterVisibilityDiffersFromPropertyVisibilityImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.SETTER_VISIBILITY_INCONSISTENT_WITH_PROPERTY_VISIBILITY) { firDiagnostic -> SetterVisibilityInconsistentWithPropertyVisibilityImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.WRONG_SETTER_RETURN_TYPE) { firDiagnostic -> WrongSetterReturnTypeImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2045,43 +2045,43 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert WrongGetterReturnTypeImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ACCESSOR_FOR_DELEGATED_PROPERTY) { firDiagnostic -> AccessorForDelegatedPropertyImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.EXPECTED_DECLARATION_WITH_BODY) { firDiagnostic -> ExpectedDeclarationWithBodyImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.EXPECTED_PROPERTY_INITIALIZER) { firDiagnostic -> ExpectedPropertyInitializerImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.EXPECTED_DELEGATED_PROPERTY) { firDiagnostic -> ExpectedDelegatedPropertyImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.EXPECTED_LATEINIT_PROPERTY) { firDiagnostic -> ExpectedLateinitPropertyImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INITIALIZER_REQUIRED_FOR_DESTRUCTURING_DECLARATION) { firDiagnostic -> InitializerRequiredForDestructuringDeclarationImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2089,7 +2089,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert ComponentFunctionMissingImpl( firDiagnostic.a, firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2099,14 +2099,14 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.b.map { abstractFirBasedSymbol -> firSymbolBuilder.buildSymbol(abstractFirBasedSymbol.fir as FirDeclaration) }, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.COMPONENT_FUNCTION_ON_NULLABLE) { firDiagnostic -> ComponentFunctionOnNullableImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2115,70 +2115,70 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a, firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b), firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.c), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.UNINITIALIZED_VARIABLE) { firDiagnostic -> UninitializedVariableImpl( firSymbolBuilder.variableLikeBuilder.buildVariableSymbol(firDiagnostic.a.fir), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.UNINITIALIZED_PARAMETER) { firDiagnostic -> UninitializedParameterImpl( firSymbolBuilder.variableLikeBuilder.buildVariableLikeSymbol(firDiagnostic.a.fir), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.UNINITIALIZED_ENUM_ENTRY) { firDiagnostic -> UninitializedEnumEntryImpl( firSymbolBuilder.variableLikeBuilder.buildVariableLikeSymbol(firDiagnostic.a.fir), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.UNINITIALIZED_ENUM_COMPANION) { firDiagnostic -> UninitializedEnumCompanionImpl( firSymbolBuilder.classifierBuilder.buildClassLikeSymbol(firDiagnostic.a.fir), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.VAL_REASSIGNMENT) { firDiagnostic -> ValReassignmentImpl( firSymbolBuilder.variableLikeBuilder.buildVariableLikeSymbol(firDiagnostic.a.fir), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.VAL_REASSIGNMENT_VIA_BACKING_FIELD) { firDiagnostic -> ValReassignmentViaBackingFieldImpl( firSymbolBuilder.variableLikeBuilder.buildVariableSymbol(firDiagnostic.a.fir), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.VAL_REASSIGNMENT_VIA_BACKING_FIELD_ERROR) { firDiagnostic -> ValReassignmentViaBackingFieldErrorImpl( firSymbolBuilder.variableLikeBuilder.buildVariableSymbol(firDiagnostic.a.fir), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CAPTURED_VAL_INITIALIZATION) { firDiagnostic -> CapturedValInitializationImpl( firSymbolBuilder.variableLikeBuilder.buildVariableSymbol(firDiagnostic.a.fir), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CAPTURED_MEMBER_VAL_INITIALIZATION) { firDiagnostic -> CapturedMemberValInitializationImpl( firSymbolBuilder.variableLikeBuilder.buildVariableSymbol(firDiagnostic.a.fir), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2187,20 +2187,20 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firSymbolBuilder.buildSymbol(firDiagnostic.a.fir as FirDeclaration), firDiagnostic.b, firDiagnostic.c, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.LEAKED_IN_PLACE_LAMBDA) { firDiagnostic -> LeakedInPlaceLambdaImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a.fir as FirDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.WRONG_IMPLIES_CONDITION) { firDiagnostic -> WrongImpliesConditionImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2208,14 +2208,14 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert UnsafeCallImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), firDiagnostic.b?.source?.psi as? KtExpression, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.UNSAFE_IMPLICIT_INVOKE_CALL) { firDiagnostic -> UnsafeImplicitInvokeCallImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2224,7 +2224,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a.source!!.psi as KtExpression, firDiagnostic.b, firDiagnostic.c.source!!.psi as KtExpression, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2233,71 +2233,71 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a.source!!.psi as KtExpression, firDiagnostic.b, firDiagnostic.c.source!!.psi as KtExpression, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ITERATOR_ON_NULLABLE) { firDiagnostic -> IteratorOnNullableImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.UNNECESSARY_SAFE_CALL) { firDiagnostic -> UnnecessarySafeCallImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.UNEXPECTED_SAFE_CALL) { firDiagnostic -> UnexpectedSafeCallImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.UNNECESSARY_NOT_NULL_ASSERTION) { firDiagnostic -> UnnecessaryNotNullAssertionImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NOT_NULL_ASSERTION_ON_LAMBDA_EXPRESSION) { firDiagnostic -> NotNullAssertionOnLambdaExpressionImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE) { firDiagnostic -> NotNullAssertionOnCallableReferenceImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.USELESS_ELVIS) { firDiagnostic -> UselessElvisImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.USELESS_ELVIS_RIGHT_IS_NULL) { firDiagnostic -> UselessElvisRightIsNullImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.USELESS_CAST) { firDiagnostic -> UselessCastImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.USELESS_IS_CHECK) { firDiagnostic -> UselessIsCheckImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2306,83 +2306,83 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a.map { whenMissingCase -> whenMissingCase }, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.INVALID_IF_AS_EXPRESSION) { firDiagnostic -> InvalidIfAsExpressionImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ELSE_MISPLACED_IN_WHEN) { firDiagnostic -> ElseMisplacedInWhenImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.TYPE_PARAMETER_IS_NOT_AN_EXPRESSION) { firDiagnostic -> TypeParameterIsNotAnExpressionImpl( firSymbolBuilder.classifierBuilder.buildTypeParameterSymbol(firDiagnostic.a.fir), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.TYPE_PARAMETER_ON_LHS_OF_DOT) { firDiagnostic -> TypeParameterOnLhsOfDotImpl( firSymbolBuilder.classifierBuilder.buildTypeParameterSymbol(firDiagnostic.a.fir), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NO_COMPANION_OBJECT) { firDiagnostic -> NoCompanionObjectImpl( firSymbolBuilder.classifierBuilder.buildClassLikeSymbol(firDiagnostic.a.fir), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.EXPRESSION_EXPECTED_PACKAGE_FOUND) { firDiagnostic -> ExpressionExpectedPackageFoundImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ERROR_IN_CONTRACT_DESCRIPTION) { firDiagnostic -> ErrorInContractDescriptionImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NO_GET_METHOD) { firDiagnostic -> NoGetMethodImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NO_SET_METHOD) { firDiagnostic -> NoSetMethodImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ITERATOR_MISSING) { firDiagnostic -> IteratorMissingImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.HAS_NEXT_MISSING) { firDiagnostic -> HasNextMissingImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NEXT_MISSING) { firDiagnostic -> NextMissingImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2391,7 +2391,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a.map { abstractFirBasedSymbol -> firSymbolBuilder.buildSymbol(abstractFirBasedSymbol.fir as FirDeclaration) }, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2400,7 +2400,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a.map { abstractFirBasedSymbol -> firSymbolBuilder.buildSymbol(abstractFirBasedSymbol.fir as FirDeclaration) }, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2409,7 +2409,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a, firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b), firDiagnostic.c, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2419,7 +2419,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.b.map { abstractFirBasedSymbol -> firSymbolBuilder.buildSymbol(abstractFirBasedSymbol.fir as FirDeclaration) }, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2429,7 +2429,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.b.map { abstractFirBasedSymbol -> firSymbolBuilder.buildSymbol(abstractFirBasedSymbol.fir as FirDeclaration) }, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2438,19 +2438,19 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a, firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b), firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.c), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.UNDERSCORE_IS_RESERVED) { firDiagnostic -> UnderscoreIsReservedImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.UNDERSCORE_USAGE_WITHOUT_BACKTICKS) { firDiagnostic -> UnderscoreUsageWithoutBackticksImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2459,7 +2459,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a, firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b), firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.c), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2468,7 +2468,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert firDiagnostic.a, firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b), firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.c), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2476,148 +2476,148 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert IncompatibleEnumComparisonErrorImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.TOPLEVEL_TYPEALIASES_ONLY) { firDiagnostic -> ToplevelTypealiasesOnlyImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.RECURSIVE_TYPEALIAS_EXPANSION) { firDiagnostic -> RecursiveTypealiasExpansionImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.REDUNDANT_VISIBILITY_MODIFIER) { firDiagnostic -> RedundantVisibilityModifierImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.REDUNDANT_MODALITY_MODIFIER) { firDiagnostic -> RedundantModalityModifierImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.REDUNDANT_RETURN_UNIT_TYPE) { firDiagnostic -> RedundantReturnUnitTypeImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.REDUNDANT_EXPLICIT_TYPE) { firDiagnostic -> RedundantExplicitTypeImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.REDUNDANT_SINGLE_EXPRESSION_STRING_TEMPLATE) { firDiagnostic -> RedundantSingleExpressionStringTemplateImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CAN_BE_VAL) { firDiagnostic -> CanBeValImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CAN_BE_REPLACED_WITH_OPERATOR_ASSIGNMENT) { firDiagnostic -> CanBeReplacedWithOperatorAssignmentImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.REDUNDANT_CALL_OF_CONVERSION_METHOD) { firDiagnostic -> RedundantCallOfConversionMethodImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ARRAY_EQUALITY_OPERATOR_CAN_BE_REPLACED_WITH_EQUALS) { firDiagnostic -> ArrayEqualityOperatorCanBeReplacedWithEqualsImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.EMPTY_RANGE) { firDiagnostic -> EmptyRangeImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.REDUNDANT_SETTER_PARAMETER_TYPE) { firDiagnostic -> RedundantSetterParameterTypeImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.UNUSED_VARIABLE) { firDiagnostic -> UnusedVariableImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.ASSIGNED_VALUE_IS_NEVER_READ) { firDiagnostic -> AssignedValueIsNeverReadImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.VARIABLE_INITIALIZER_IS_REDUNDANT) { firDiagnostic -> VariableInitializerIsRedundantImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.VARIABLE_NEVER_READ) { firDiagnostic -> VariableNeverReadImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.USELESS_CALL_ON_NOT_NULL) { firDiagnostic -> UselessCallOnNotNullImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.RETURN_NOT_ALLOWED) { firDiagnostic -> ReturnNotAllowedImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY) { firDiagnostic -> ReturnInFunctionWithExpressionBodyImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.USAGE_IS_NOT_INLINABLE) { firDiagnostic -> UsageIsNotInlinableImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a.fir as FirDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.NON_LOCAL_RETURN_NOT_ALLOWED) { firDiagnostic -> NonLocalReturnNotAllowedImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a.fir as FirDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.RECURSION_IN_INLINE) { firDiagnostic -> RecursionInInlineImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a.fir as FirDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2625,7 +2625,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert NonPublicCallFromPublicInlineImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a.fir as FirDeclaration), firSymbolBuilder.buildSymbol(firDiagnostic.b.fir as FirDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2633,7 +2633,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert ProtectedConstructorCallFromPublicInlineImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a.fir as FirDeclaration), firSymbolBuilder.buildSymbol(firDiagnostic.b.fir as FirDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2641,7 +2641,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert ProtectedCallFromPublicInlineErrorImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a.fir as FirDeclaration), firSymbolBuilder.buildSymbol(firDiagnostic.b.fir as FirDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2649,7 +2649,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert ProtectedCallFromPublicInlineImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a.fir as FirDeclaration), firSymbolBuilder.buildSymbol(firDiagnostic.b.fir as FirDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } @@ -2657,53 +2657,53 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert PrivateClassMemberFromInlineImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a.fir as FirDeclaration), firSymbolBuilder.buildSymbol(firDiagnostic.b.fir as FirDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.SUPER_CALL_FROM_PUBLIC_INLINE) { firDiagnostic -> SuperCallFromPublicInlineImpl( firSymbolBuilder.buildSymbol(firDiagnostic.a.fir as FirDeclaration), - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CANNOT_ALL_UNDER_IMPORT_FROM_SINGLETON) { firDiagnostic -> CannotAllUnderImportFromSingletonImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.PACKAGE_CANNOT_BE_IMPORTED) { firDiagnostic -> PackageCannotBeImportedImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CANNOT_BE_IMPORTED) { firDiagnostic -> CannotBeImportedImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.CONFLICTING_IMPORT) { firDiagnostic -> ConflictingImportImpl( firDiagnostic.a, - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirErrors.OPERATOR_RENAMED_ON_IMPORT) { firDiagnostic -> OperatorRenamedOnImportImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } add(FirJvmErrors.CONFLICTING_JVM_DECLARATIONS) { firDiagnostic -> ConflictingJvmDeclarationsImpl( - firDiagnostic as FirPsiDiagnostic<*>, + firDiagnostic as FirPsiDiagnostic, token, ) } diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt index 42b00b57813..edd8c9d9245 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt @@ -72,1610 +72,1610 @@ import org.jetbrains.kotlin.types.Variance internal class UnsupportedImpl( override val unsupported: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.Unsupported(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UnsupportedFeatureImpl( override val unsupportedFeature: Pair, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UnsupportedFeature(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NewInferenceErrorImpl( override val error: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NewInferenceError(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class SyntaxImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.Syntax(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class OtherErrorImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.OtherError(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class IllegalConstExpressionImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.IllegalConstExpression(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class IllegalUnderscoreImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.IllegalUnderscore(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExpressionExpectedImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExpressionExpected(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AssignmentInExpressionContextImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AssignmentInExpressionContext(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class BreakOrContinueOutsideALoopImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.BreakOrContinueOutsideALoop(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NotALoopLabelImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NotALoopLabel(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class VariableExpectedImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.VariableExpected(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class DelegationInInterfaceImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.DelegationInInterface(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NestedClassNotAllowedImpl( override val declaration: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NestedClassNotAllowed(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class IncorrectCharacterLiteralImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.IncorrectCharacterLiteral(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class EmptyCharacterLiteralImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.EmptyCharacterLiteral(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class TooManyCharactersInCharacterLiteralImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.TooManyCharactersInCharacterLiteral(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class IllegalEscapeImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.IllegalEscape(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class IntLiteralOutOfRangeImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.IntLiteralOutOfRange(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class FloatLiteralOutOfRangeImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.FloatLiteralOutOfRange(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class WrongLongSuffixImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.WrongLongSuffix(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class DivisionByZeroImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.DivisionByZero(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ValOrVarOnLoopParameterImpl( override val valOrVar: KtKeywordToken, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ValOrVarOnLoopParameter(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ValOrVarOnFunParameterImpl( override val valOrVar: KtKeywordToken, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ValOrVarOnFunParameter(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ValOrVarOnCatchParameterImpl( override val valOrVar: KtKeywordToken, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ValOrVarOnCatchParameter(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ValOrVarOnSecondaryConstructorParameterImpl( override val valOrVar: KtKeywordToken, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ValOrVarOnSecondaryConstructorParameter(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InvisibleReferenceImpl( override val reference: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InvisibleReference(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UnresolvedReferenceImpl( override val reference: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UnresolvedReference(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UnresolvedLabelImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UnresolvedLabel(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class DeserializationErrorImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.DeserializationError(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ErrorFromJavaResolutionImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ErrorFromJavaResolution(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UnknownCallableKindImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UnknownCallableKind(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class MissingStdlibClassImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.MissingStdlibClass(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NoThisImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NoThis(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class CreatingAnInstanceOfAbstractClassImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.CreatingAnInstanceOfAbstractClass(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class SuperIsNotAnExpressionImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.SuperIsNotAnExpression(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class SuperNotAvailableImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.SuperNotAvailable(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AbstractSuperCallImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AbstractSuperCall(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InstanceAccessBeforeSuperCallImpl( override val target: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InstanceAccessBeforeSuperCall(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class EnumAsSupertypeImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.EnumAsSupertype(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class RecursionInSupertypesImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.RecursionInSupertypes(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NotASupertypeImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NotASupertype(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class SuperclassNotAccessibleFromInterfaceImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.SuperclassNotAccessibleFromInterface(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class QualifiedSupertypeExtendedByOtherSupertypeImpl( override val otherSuperType: KtClassLikeSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.QualifiedSupertypeExtendedByOtherSupertype(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class SupertypeInitializedInInterfaceImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.SupertypeInitializedInInterface(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InterfaceWithSuperclassImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InterfaceWithSuperclass(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class FinalSupertypeImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.FinalSupertype(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class SupertypeIsExtensionFunctionTypeImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.SupertypeIsExtensionFunctionType(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class SingletonInSupertypeImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.SingletonInSupertype(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NullableSupertypeImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NullableSupertype(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ManyClassesInSupertypeListImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ManyClassesInSupertypeList(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class SupertypeAppearsTwiceImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.SupertypeAppearsTwice(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ClassInSupertypeForEnumImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ClassInSupertypeForEnum(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class SealedSupertypeImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.SealedSupertype(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class SealedSupertypeInLocalClassImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.SealedSupertypeInLocalClass(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class SupertypeNotAClassOrInterfaceImpl( override val reason: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.SupertypeNotAClassOrInterface(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class CyclicInheritanceHierarchyImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.CyclicInheritanceHierarchy(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ConstructorInObjectImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ConstructorInObject(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ConstructorInInterfaceImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ConstructorInInterface(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NonPrivateConstructorInEnumImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NonPrivateConstructorInEnum(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NonPrivateOrProtectedConstructorInSealedImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NonPrivateOrProtectedConstructorInSealed(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class CyclicConstructorDelegationCallImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.CyclicConstructorDelegationCall(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class PrimaryConstructorDelegationCallExpectedImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.PrimaryConstructorDelegationCallExpected(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class SupertypeNotInitializedImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.SupertypeNotInitialized(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class SupertypeInitializedWithoutPrimaryConstructorImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.SupertypeInitializedWithoutPrimaryConstructor(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class DelegationSuperCallInEnumConstructorImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.DelegationSuperCallInEnumConstructor(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class PrimaryConstructorRequiredForDataClassImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.PrimaryConstructorRequiredForDataClass(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExplicitDelegationCallRequiredImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExplicitDelegationCallRequired(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class SealedClassConstructorCallImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.SealedClassConstructorCall(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class DataClassWithoutParametersImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.DataClassWithoutParameters(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class DataClassVarargParameterImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.DataClassVarargParameter(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class DataClassNotPropertyParameterImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.DataClassNotPropertyParameter(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AnnotationArgumentKclassLiteralOfTypeParameterErrorImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AnnotationArgumentKclassLiteralOfTypeParameterError(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AnnotationArgumentMustBeConstImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AnnotationArgumentMustBeConst(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AnnotationArgumentMustBeEnumConstImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AnnotationArgumentMustBeEnumConst(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AnnotationArgumentMustBeKclassLiteralImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AnnotationArgumentMustBeKclassLiteral(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AnnotationClassMemberImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AnnotationClassMember(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AnnotationParameterDefaultValueMustBeConstantImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AnnotationParameterDefaultValueMustBeConstant(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InvalidTypeOfAnnotationMemberImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InvalidTypeOfAnnotationMember(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class LocalAnnotationClassErrorImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.LocalAnnotationClassError(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class MissingValOnAnnotationParameterImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.MissingValOnAnnotationParameter(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NonConstValUsedInConstantExpressionImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NonConstValUsedInConstantExpression(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AnnotationClassConstructorCallImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AnnotationClassConstructorCall(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NotAnAnnotationClassImpl( override val annotationName: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NotAnAnnotationClass(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NullableTypeOfAnnotationMemberImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NullableTypeOfAnnotationMember(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class VarAnnotationParameterImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.VarAnnotationParameter(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class SupertypesForAnnotationClassImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.SupertypesForAnnotationClass(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AnnotationUsedAsAnnotationArgumentImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AnnotationUsedAsAnnotationArgument(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class IllegalKotlinVersionStringValueImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.IllegalKotlinVersionStringValue(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NewerVersionInSinceKotlinImpl( override val specifiedVersion: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NewerVersionInSinceKotlin(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class DeprecatedSinceKotlinWithUnorderedVersionsImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.DeprecatedSinceKotlinWithUnorderedVersions(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class DeprecatedSinceKotlinWithoutArgumentsImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.DeprecatedSinceKotlinWithoutArguments(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class DeprecatedSinceKotlinWithoutDeprecatedImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.DeprecatedSinceKotlinWithoutDeprecated(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class DeprecatedSinceKotlinWithDeprecatedLevelImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.DeprecatedSinceKotlinWithDeprecatedLevel(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class DeprecatedSinceKotlinOutsideKotlinSubpackageImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.DeprecatedSinceKotlinOutsideKotlinSubpackage(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AnnotationOnSuperclassImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AnnotationOnSuperclass(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class RestrictedRetentionForExpressionAnnotationImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.RestrictedRetentionForExpressionAnnotation(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class WrongAnnotationTargetImpl( override val actualTarget: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.WrongAnnotationTarget(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class WrongAnnotationTargetWithUseSiteTargetImpl( override val actualTarget: String, override val useSiteTarget: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.WrongAnnotationTargetWithUseSiteTarget(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InapplicableTargetOnPropertyImpl( override val useSiteDescription: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InapplicableTargetOnProperty(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InapplicableTargetPropertyImmutableImpl( override val useSiteDescription: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InapplicableTargetPropertyImmutable(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InapplicableTargetPropertyHasNoDelegateImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InapplicableTargetPropertyHasNoDelegate(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InapplicableTargetPropertyHasNoBackingFieldImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InapplicableTargetPropertyHasNoBackingField(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InapplicableParamTargetImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InapplicableParamTarget(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class RedundantAnnotationTargetImpl( override val useSiteDescription: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.RedundantAnnotationTarget(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InapplicableFileTargetImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InapplicableFileTarget(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExperimentalApiUsageImpl( override val optInMarkerFqName: FqName, override val message: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExperimentalApiUsage(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExperimentalApiUsageErrorImpl( override val optInMarkerFqName: FqName, override val message: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExperimentalApiUsageError(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExperimentalOverrideImpl( override val optInMarkerFqName: FqName, override val message: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExperimentalOverride(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExperimentalOverrideErrorImpl( override val optInMarkerFqName: FqName, override val message: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExperimentalOverrideError(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExperimentalIsNotEnabledImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExperimentalIsNotEnabled(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExperimentalCanOnlyBeUsedAsAnnotationImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExperimentalCanOnlyBeUsedAsAnnotation(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExperimentalMarkerCanOnlyBeUsedAsAnnotationOrArgumentInUseExperimentalImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExperimentalMarkerCanOnlyBeUsedAsAnnotationOrArgumentInUseExperimental(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UseExperimentalWithoutArgumentsImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UseExperimentalWithoutArguments(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UseExperimentalArgumentIsNotMarkerImpl( override val notMarkerFqName: FqName, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UseExperimentalArgumentIsNotMarker(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExperimentalAnnotationWithWrongTargetImpl( override val target: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExperimentalAnnotationWithWrongTarget(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExperimentalAnnotationWithWrongRetentionImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExperimentalAnnotationWithWrongRetention(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExposedTypealiasExpandedTypeImpl( override val elementVisibility: EffectiveVisibility, override val restrictingDeclaration: KtSymbol, override val restrictingVisibility: EffectiveVisibility, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExposedTypealiasExpandedType(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExposedFunctionReturnTypeImpl( override val elementVisibility: EffectiveVisibility, override val restrictingDeclaration: KtSymbol, override val restrictingVisibility: EffectiveVisibility, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExposedFunctionReturnType(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExposedReceiverTypeImpl( override val elementVisibility: EffectiveVisibility, override val restrictingDeclaration: KtSymbol, override val restrictingVisibility: EffectiveVisibility, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExposedReceiverType(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExposedPropertyTypeImpl( override val elementVisibility: EffectiveVisibility, override val restrictingDeclaration: KtSymbol, override val restrictingVisibility: EffectiveVisibility, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExposedPropertyType(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExposedPropertyTypeInConstructorImpl( override val elementVisibility: EffectiveVisibility, override val restrictingDeclaration: KtSymbol, override val restrictingVisibility: EffectiveVisibility, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExposedPropertyTypeInConstructor(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExposedParameterTypeImpl( override val elementVisibility: EffectiveVisibility, override val restrictingDeclaration: KtSymbol, override val restrictingVisibility: EffectiveVisibility, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExposedParameterType(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExposedSuperInterfaceImpl( override val elementVisibility: EffectiveVisibility, override val restrictingDeclaration: KtSymbol, override val restrictingVisibility: EffectiveVisibility, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExposedSuperInterface(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExposedSuperClassImpl( override val elementVisibility: EffectiveVisibility, override val restrictingDeclaration: KtSymbol, override val restrictingVisibility: EffectiveVisibility, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExposedSuperClass(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExposedTypeParameterBoundImpl( override val elementVisibility: EffectiveVisibility, override val restrictingDeclaration: KtSymbol, override val restrictingVisibility: EffectiveVisibility, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExposedTypeParameterBound(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InapplicableInfixModifierImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InapplicableInfixModifier(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class RepeatedModifierImpl( override val modifier: KtModifierKeywordToken, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.RepeatedModifier(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class RedundantModifierImpl( override val redundantModifier: KtModifierKeywordToken, override val conflictingModifier: KtModifierKeywordToken, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.RedundantModifier(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class DeprecatedModifierPairImpl( override val deprecatedModifier: KtModifierKeywordToken, override val conflictingModifier: KtModifierKeywordToken, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.DeprecatedModifierPair(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class IncompatibleModifiersImpl( override val modifier1: KtModifierKeywordToken, override val modifier2: KtModifierKeywordToken, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.IncompatibleModifiers(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class RedundantOpenInInterfaceImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.RedundantOpenInInterface(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class WrongModifierTargetImpl( override val modifier: KtModifierKeywordToken, override val target: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.WrongModifierTarget(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class OperatorModifierRequiredImpl( override val functionSymbol: KtFunctionLikeSymbol, override val name: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.OperatorModifierRequired(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InfixModifierRequiredImpl( override val functionSymbol: KtFunctionLikeSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InfixModifierRequired(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InlineClassNotTopLevelImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InlineClassNotTopLevel(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InlineClassNotFinalImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InlineClassNotFinal(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AbsenceOfPrimaryConstructorForInlineClassImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AbsenceOfPrimaryConstructorForInlineClass(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InlineClassConstructorWrongParametersSizeImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InlineClassConstructorWrongParametersSize(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InlineClassConstructorNotFinalReadOnlyParameterImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InlineClassConstructorNotFinalReadOnlyParameter(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class PropertyWithBackingFieldInsideInlineClassImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.PropertyWithBackingFieldInsideInlineClass(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class DelegatedPropertyInsideInlineClassImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.DelegatedPropertyInsideInlineClass(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InlineClassHasInapplicableParameterTypeImpl( override val type: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InlineClassHasInapplicableParameterType(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InlineClassCannotImplementInterfaceByDelegationImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InlineClassCannotImplementInterfaceByDelegation(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InlineClassCannotExtendClassesImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InlineClassCannotExtendClasses(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InlineClassCannotBeRecursiveImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InlineClassCannotBeRecursive(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ReservedMemberInsideInlineClassImpl( override val name: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ReservedMemberInsideInlineClass(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class SecondaryConstructorWithBodyInsideInlineClassImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.SecondaryConstructorWithBodyInsideInlineClass(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InnerClassInsideInlineClassImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InnerClassInsideInlineClass(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ValueClassCannotBeCloneableImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ValueClassCannotBeCloneable(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NoneApplicableImpl( override val candidates: List, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NoneApplicable(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InapplicableCandidateImpl( override val candidate: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InapplicableCandidate(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class TypeMismatchImpl( override val expectedType: KtType, override val actualType: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.TypeMismatch(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ThrowableTypeMismatchImpl( override val actualType: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ThrowableTypeMismatch(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ConditionTypeMismatchImpl( override val actualType: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ConditionTypeMismatch(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ArgumentTypeMismatchImpl( override val expectedType: KtType, override val actualType: KtType, override val isMismatchDueToNullability: Boolean, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ArgumentTypeMismatch(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NullForNonnullTypeImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NullForNonnullType(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InapplicableLateinitModifierImpl( override val reason: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InapplicableLateinitModifier(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class VarargOutsideParenthesesImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.VarargOutsideParentheses(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NamedArgumentsNotAllowedImpl( override val forbiddenNamedArgumentsTarget: ForbiddenNamedArgumentsTarget, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NamedArgumentsNotAllowed(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NonVarargSpreadImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NonVarargSpread(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ArgumentPassedTwiceImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ArgumentPassedTwice(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class TooManyArgumentsImpl( override val function: KtCallableSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.TooManyArguments(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NoValueForParameterImpl( override val violatedParameter: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NoValueForParameter(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NamedParameterNotFoundImpl( override val name: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NamedParameterNotFound(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AssignmentTypeMismatchImpl( override val expectedType: KtType, override val actualType: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AssignmentTypeMismatch(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ResultTypeMismatchImpl( override val expectedType: KtType, override val actualType: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ResultTypeMismatch(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ManyLambdaExpressionArgumentsImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ManyLambdaExpressionArguments(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NewInferenceNoInformationForParameterImpl( override val name: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NewInferenceNoInformationForParameter(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class OverloadResolutionAmbiguityImpl( override val candidates: List, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.OverloadResolutionAmbiguity(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AssignOperatorAmbiguityImpl( override val candidates: List, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AssignOperatorAmbiguity(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class IteratorAmbiguityImpl( override val candidates: List, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.IteratorAmbiguity(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class HasNextFunctionAmbiguityImpl( override val candidates: List, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.HasNextFunctionAmbiguity(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NextAmbiguityImpl( override val candidates: List, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NextAmbiguity(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class RecursionInImplicitTypesImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.RecursionInImplicitTypes(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InferenceErrorImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InferenceError(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ProjectionOnNonClassTypeArgumentImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ProjectionOnNonClassTypeArgument(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UpperBoundViolatedImpl( override val upperBound: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UpperBoundViolated(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class TypeArgumentsNotAllowedImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.TypeArgumentsNotAllowed(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class WrongNumberOfTypeArgumentsImpl( override val expectedCount: Int, override val classifier: KtClassLikeSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.WrongNumberOfTypeArguments(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NoTypeArgumentsOnRhsImpl( override val expectedCount: Int, override val classifier: KtClassLikeSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NoTypeArgumentsOnRhs(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class TypeParametersInObjectImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.TypeParametersInObject(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class IllegalProjectionUsageImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.IllegalProjectionUsage(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class TypeParametersInEnumImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.TypeParametersInEnum(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ConflictingProjectionImpl( override val type: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ConflictingProjection(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ConflictingProjectionInTypealiasExpansionImpl( override val type: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ConflictingProjectionInTypealiasExpansion(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class RedundantProjectionImpl( override val type: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.RedundantProjection(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class VarianceOnTypeParameterNotAllowedImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.VarianceOnTypeParameterNotAllowed(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class CatchParameterWithDefaultValueImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.CatchParameterWithDefaultValue(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ReifiedTypeInCatchClauseImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ReifiedTypeInCatchClause(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class TypeParameterInCatchClauseImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.TypeParameterInCatchClause(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class GenericThrowableSubclassImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.GenericThrowableSubclass(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InnerClassOfGenericThrowableSubclassImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InnerClassOfGenericThrowableSubclass(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class KclassWithNullableTypeParameterInSignatureImpl( override val typeParameter: KtTypeParameterSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.KclassWithNullableTypeParameterInSignature(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class TypeParameterAsReifiedImpl( override val typeParameter: KtTypeParameterSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.TypeParameterAsReified(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class FinalUpperBoundImpl( override val type: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.FinalUpperBound(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UpperBoundIsExtensionFunctionTypeImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UpperBoundIsExtensionFunctionType(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class BoundsNotAllowedIfBoundedByTypeParameterImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.BoundsNotAllowedIfBoundedByTypeParameter(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class OnlyOneClassBoundAllowedImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.OnlyOneClassBoundAllowed(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class RepeatedBoundImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.RepeatedBound(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ConflictingUpperBoundsImpl( override val typeParameter: KtTypeParameterSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ConflictingUpperBounds(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NameInConstraintIsNotATypeParameterImpl( override val typeParameterName: Name, override val typeParametersOwner: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NameInConstraintIsNotATypeParameter(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class BoundOnTypeAliasParameterNotAllowedImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.BoundOnTypeAliasParameterNotAllowed(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ReifiedTypeParameterNoInlineImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ReifiedTypeParameterNoInline(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class TypeParametersNotAllowedImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.TypeParametersNotAllowed(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class TypeParameterOfPropertyNotUsedInReceiverImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.TypeParameterOfPropertyNotUsedInReceiver(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ReturnTypeMismatchImpl( override val expectedType: KtType, override val actualType: KtType, override val targetFunction: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ReturnTypeMismatch(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class CyclicGenericUpperBoundImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.CyclicGenericUpperBound(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class DeprecatedTypeParameterSyntaxImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.DeprecatedTypeParameterSyntax(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class MisplacedTypeParameterConstraintsImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.MisplacedTypeParameterConstraints(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class DynamicUpperBoundImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.DynamicUpperBound(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class IncompatibleTypesImpl( override val typeA: KtType, override val typeB: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.IncompatibleTypes(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class IncompatibleTypesWarningImpl( override val typeA: KtType, override val typeB: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.IncompatibleTypesWarning(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class TypeVarianceConflictImpl( @@ -1683,10 +1683,10 @@ internal class TypeVarianceConflictImpl( override val typeParameterVariance: Variance, override val variance: Variance, override val containingType: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.TypeVarianceConflict(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class TypeVarianceConflictInExpandedTypeImpl( @@ -1694,1391 +1694,1391 @@ internal class TypeVarianceConflictInExpandedTypeImpl( override val typeParameterVariance: Variance, override val variance: Variance, override val containingType: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.TypeVarianceConflictInExpandedType(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class SmartcastImpossibleImpl( override val desiredType: KtType, override val subject: KtExpression, override val description: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.SmartcastImpossible(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExtensionInClassReferenceNotAllowedImpl( override val referencedDeclaration: KtCallableSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExtensionInClassReferenceNotAllowed(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class CallableReferenceLhsNotAClassImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.CallableReferenceLhsNotAClass(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class CallableReferenceToAnnotationConstructorImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.CallableReferenceToAnnotationConstructor(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ClassLiteralLhsNotAClassImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ClassLiteralLhsNotAClass(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NullableTypeInClassLiteralLhsImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NullableTypeInClassLiteralLhs(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExpressionOfNullableTypeInClassLiteralLhsImpl( override val lhsType: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExpressionOfNullableTypeInClassLiteralLhs(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NothingToOverrideImpl( override val declaration: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NothingToOverride(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class CannotWeakenAccessPrivilegeImpl( override val overridingVisibility: Visibility, override val overridden: KtCallableSymbol, override val containingClassName: Name, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.CannotWeakenAccessPrivilege(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class CannotChangeAccessPrivilegeImpl( override val overridingVisibility: Visibility, override val overridden: KtCallableSymbol, override val containingClassName: Name, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.CannotChangeAccessPrivilege(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class OverridingFinalMemberImpl( override val overriddenDeclaration: KtCallableSymbol, override val containingClassName: Name, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.OverridingFinalMember(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AbstractMemberNotImplementedImpl( override val classOrObject: KtClassLikeSymbol, override val missingDeclaration: KtCallableSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AbstractMemberNotImplemented(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AbstractClassMemberNotImplementedImpl( override val classOrObject: KtClassLikeSymbol, override val missingDeclaration: KtCallableSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AbstractClassMemberNotImplemented(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InvisibleAbstractMemberFromSuperImpl( override val classOrObject: KtClassLikeSymbol, override val invisibleDeclaration: KtCallableSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InvisibleAbstractMemberFromSuper(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InvisibleAbstractMemberFromSuperWarningImpl( override val classOrObject: KtClassLikeSymbol, override val invisibleDeclaration: KtCallableSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InvisibleAbstractMemberFromSuperWarning(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ManyImplMemberNotImplementedImpl( override val classOrObject: KtClassLikeSymbol, override val missingDeclaration: KtCallableSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ManyImplMemberNotImplemented(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ManyInterfacesMemberNotImplementedImpl( override val classOrObject: KtClassLikeSymbol, override val missingDeclaration: KtCallableSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ManyInterfacesMemberNotImplemented(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class OverridingFinalMemberByDelegationImpl( override val delegatedDeclaration: KtCallableSymbol, override val overriddenDeclaration: KtCallableSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.OverridingFinalMemberByDelegation(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class DelegatedMemberHidesSupertypeOverrideImpl( override val delegatedDeclaration: KtCallableSymbol, override val overriddenDeclaration: KtCallableSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.DelegatedMemberHidesSupertypeOverride(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ReturnTypeMismatchOnOverrideImpl( override val function: KtSymbol, override val superFunction: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ReturnTypeMismatchOnOverride(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class PropertyTypeMismatchOnOverrideImpl( override val property: KtSymbol, override val superProperty: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.PropertyTypeMismatchOnOverride(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class VarTypeMismatchOnOverrideImpl( override val variable: KtSymbol, override val superVariable: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.VarTypeMismatchOnOverride(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class VarOverriddenByValImpl( override val overridingDeclaration: KtSymbol, override val overriddenDeclaration: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.VarOverriddenByVal(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NonFinalMemberInFinalClassImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NonFinalMemberInFinalClass(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NonFinalMemberInObjectImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NonFinalMemberInObject(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class VirtualMemberHiddenImpl( override val declared: KtSymbol, override val overriddenContainer: KtNamedClassOrObjectSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.VirtualMemberHidden(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ManyCompanionObjectsImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ManyCompanionObjects(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ConflictingOverloadsImpl( override val conflictingOverloads: List, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ConflictingOverloads(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class RedeclarationImpl( override val conflictingDeclarations: List, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.Redeclaration(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class MethodOfAnyImplementedInInterfaceImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.MethodOfAnyImplementedInInterface(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class LocalObjectNotAllowedImpl( override val objectName: Name, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.LocalObjectNotAllowed(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class LocalInterfaceNotAllowedImpl( override val interfaceName: Name, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.LocalInterfaceNotAllowed(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AbstractFunctionInNonAbstractClassImpl( override val function: KtSymbol, override val containingClass: KtClassLikeSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AbstractFunctionInNonAbstractClass(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AbstractFunctionWithBodyImpl( override val function: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AbstractFunctionWithBody(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NonAbstractFunctionWithNoBodyImpl( override val function: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NonAbstractFunctionWithNoBody(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class PrivateFunctionWithNoBodyImpl( override val function: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.PrivateFunctionWithNoBody(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NonMemberFunctionNoBodyImpl( override val function: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NonMemberFunctionNoBody(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class FunctionDeclarationWithNoNameImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.FunctionDeclarationWithNoName(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AnonymousFunctionWithNameImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AnonymousFunctionWithName(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AnonymousFunctionParameterWithDefaultValueImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AnonymousFunctionParameterWithDefaultValue(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UselessVarargOnParameterImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UselessVarargOnParameter(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class MultipleVarargParametersImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.MultipleVarargParameters(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ForbiddenVarargParameterTypeImpl( override val varargParameterType: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ForbiddenVarargParameterType(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ValueParameterWithNoTypeAnnotationImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ValueParameterWithNoTypeAnnotation(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class CannotInferParameterTypeImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.CannotInferParameterType(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class FunInterfaceConstructorReferenceImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.FunInterfaceConstructorReference(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class FunInterfaceWrongCountOfAbstractMembersImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.FunInterfaceWrongCountOfAbstractMembers(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class FunInterfaceCannotHaveAbstractPropertiesImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.FunInterfaceCannotHaveAbstractProperties(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class FunInterfaceAbstractMethodWithTypeParametersImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.FunInterfaceAbstractMethodWithTypeParameters(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class FunInterfaceAbstractMethodWithDefaultValueImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.FunInterfaceAbstractMethodWithDefaultValue(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class FunInterfaceWithSuspendFunctionImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.FunInterfaceWithSuspendFunction(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AbstractPropertyInNonAbstractClassImpl( override val property: KtSymbol, override val containingClass: KtClassLikeSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AbstractPropertyInNonAbstractClass(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class PrivatePropertyInInterfaceImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.PrivatePropertyInInterface(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AbstractPropertyWithInitializerImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AbstractPropertyWithInitializer(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class PropertyInitializerInInterfaceImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.PropertyInitializerInInterface(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class PropertyWithNoTypeNoInitializerImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.PropertyWithNoTypeNoInitializer(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class MustBeInitializedImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.MustBeInitialized(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class MustBeInitializedOrBeAbstractImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.MustBeInitializedOrBeAbstract(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExtensionPropertyMustHaveAccessorsOrBeAbstractImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExtensionPropertyMustHaveAccessorsOrBeAbstract(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UnnecessaryLateinitImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UnnecessaryLateinit(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class BackingFieldInInterfaceImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.BackingFieldInInterface(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExtensionPropertyWithBackingFieldImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExtensionPropertyWithBackingField(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class PropertyInitializerNoBackingFieldImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.PropertyInitializerNoBackingField(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AbstractDelegatedPropertyImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AbstractDelegatedProperty(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class DelegatedPropertyInInterfaceImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.DelegatedPropertyInInterface(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AbstractPropertyWithGetterImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AbstractPropertyWithGetter(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AbstractPropertyWithSetterImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AbstractPropertyWithSetter(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class PrivateSetterForAbstractPropertyImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.PrivateSetterForAbstractProperty(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class PrivateSetterForOpenPropertyImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.PrivateSetterForOpenProperty(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExpectedPrivateDeclarationImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExpectedPrivateDeclaration(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ValWithSetterImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ValWithSetter(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ConstValNotTopLevelOrObjectImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ConstValNotTopLevelOrObject(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ConstValWithGetterImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ConstValWithGetter(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ConstValWithDelegateImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ConstValWithDelegate(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class TypeCantBeUsedForConstValImpl( override val constValType: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.TypeCantBeUsedForConstVal(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ConstValWithoutInitializerImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ConstValWithoutInitializer(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ConstValWithNonConstInitializerImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ConstValWithNonConstInitializer(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class WrongSetterParameterTypeImpl( override val expectedType: KtType, override val actualType: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.WrongSetterParameterType(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InitializerTypeMismatchImpl( override val expectedType: KtType, override val actualType: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InitializerTypeMismatch(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class GetterVisibilityDiffersFromPropertyVisibilityImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.GetterVisibilityDiffersFromPropertyVisibility(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class SetterVisibilityInconsistentWithPropertyVisibilityImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.SetterVisibilityInconsistentWithPropertyVisibility(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class WrongSetterReturnTypeImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.WrongSetterReturnType(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class WrongGetterReturnTypeImpl( override val expectedType: KtType, override val actualType: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.WrongGetterReturnType(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AccessorForDelegatedPropertyImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AccessorForDelegatedProperty(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExpectedDeclarationWithBodyImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExpectedDeclarationWithBody(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExpectedPropertyInitializerImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExpectedPropertyInitializer(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExpectedDelegatedPropertyImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExpectedDelegatedProperty(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExpectedLateinitPropertyImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExpectedLateinitProperty(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InitializerRequiredForDestructuringDeclarationImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InitializerRequiredForDestructuringDeclaration(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ComponentFunctionMissingImpl( override val missingFunctionName: Name, override val destructingType: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ComponentFunctionMissing(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ComponentFunctionAmbiguityImpl( override val functionWithAmbiguityName: Name, override val candidates: List, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ComponentFunctionAmbiguity(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ComponentFunctionOnNullableImpl( override val componentFunctionName: Name, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ComponentFunctionOnNullable(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ComponentFunctionReturnTypeMismatchImpl( override val componentFunctionName: Name, override val destructingType: KtType, override val expectedType: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ComponentFunctionReturnTypeMismatch(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UninitializedVariableImpl( override val variable: KtVariableSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UninitializedVariable(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UninitializedParameterImpl( override val parameter: KtVariableLikeSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UninitializedParameter(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UninitializedEnumEntryImpl( override val enumEntry: KtVariableLikeSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UninitializedEnumEntry(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UninitializedEnumCompanionImpl( override val enumClass: KtClassLikeSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UninitializedEnumCompanion(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ValReassignmentImpl( override val variable: KtVariableLikeSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ValReassignment(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ValReassignmentViaBackingFieldImpl( override val property: KtVariableSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ValReassignmentViaBackingField(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ValReassignmentViaBackingFieldErrorImpl( override val property: KtVariableSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ValReassignmentViaBackingFieldError(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class CapturedValInitializationImpl( override val property: KtVariableSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.CapturedValInitialization(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class CapturedMemberValInitializationImpl( override val property: KtVariableSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.CapturedMemberValInitialization(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class WrongInvocationKindImpl( override val declaration: KtSymbol, override val requiredRange: EventOccurrencesRange, override val actualRange: EventOccurrencesRange, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.WrongInvocationKind(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class LeakedInPlaceLambdaImpl( override val lambda: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.LeakedInPlaceLambda(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class WrongImpliesConditionImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.WrongImpliesCondition(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UnsafeCallImpl( override val receiverType: KtType, override val receiverExpression: KtExpression?, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UnsafeCall(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UnsafeImplicitInvokeCallImpl( override val receiverType: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UnsafeImplicitInvokeCall(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UnsafeInfixCallImpl( override val receiverExpression: KtExpression, override val operator: String, override val argumentExpression: KtExpression, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UnsafeInfixCall(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UnsafeOperatorCallImpl( override val receiverExpression: KtExpression, override val operator: String, override val argumentExpression: KtExpression, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UnsafeOperatorCall(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class IteratorOnNullableImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.IteratorOnNullable(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UnnecessarySafeCallImpl( override val receiverType: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UnnecessarySafeCall(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UnexpectedSafeCallImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UnexpectedSafeCall(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UnnecessaryNotNullAssertionImpl( override val receiverType: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UnnecessaryNotNullAssertion(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NotNullAssertionOnLambdaExpressionImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NotNullAssertionOnLambdaExpression(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NotNullAssertionOnCallableReferenceImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NotNullAssertionOnCallableReference(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UselessElvisImpl( override val receiverType: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UselessElvis(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UselessElvisRightIsNullImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UselessElvisRightIsNull(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UselessCastImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UselessCast(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UselessIsCheckImpl( override val compileTimeCheckResult: Boolean, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UselessIsCheck(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NoElseInWhenImpl( override val missingWhenCases: List, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NoElseInWhen(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class InvalidIfAsExpressionImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.InvalidIfAsExpression(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ElseMisplacedInWhenImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ElseMisplacedInWhen(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class TypeParameterIsNotAnExpressionImpl( override val typeParameter: KtTypeParameterSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.TypeParameterIsNotAnExpression(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class TypeParameterOnLhsOfDotImpl( override val typeParameter: KtTypeParameterSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.TypeParameterOnLhsOfDot(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NoCompanionObjectImpl( override val klass: KtClassLikeSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NoCompanionObject(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ExpressionExpectedPackageFoundImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ExpressionExpectedPackageFound(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ErrorInContractDescriptionImpl( override val reason: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ErrorInContractDescription(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NoGetMethodImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NoGetMethod(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NoSetMethodImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NoSetMethod(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class IteratorMissingImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.IteratorMissing(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class HasNextMissingImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.HasNextMissing(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NextMissingImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NextMissing(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class HasNextFunctionNoneApplicableImpl( override val candidates: List, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.HasNextFunctionNoneApplicable(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NextNoneApplicableImpl( override val candidates: List, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NextNoneApplicable(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class DelegateSpecialFunctionMissingImpl( override val expectedFunctionSignature: String, override val delegateType: KtType, override val description: String, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.DelegateSpecialFunctionMissing(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class DelegateSpecialFunctionAmbiguityImpl( override val expectedFunctionSignature: String, override val candidates: List, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.DelegateSpecialFunctionAmbiguity(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class DelegateSpecialFunctionNoneApplicableImpl( override val expectedFunctionSignature: String, override val candidates: List, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.DelegateSpecialFunctionNoneApplicable(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class DelegateSpecialFunctionReturnTypeMismatchImpl( override val delegateFunction: String, override val expectedType: KtType, override val actualType: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.DelegateSpecialFunctionReturnTypeMismatch(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UnderscoreIsReservedImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UnderscoreIsReserved(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UnderscoreUsageWithoutBackticksImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UnderscoreUsageWithoutBackticks(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class EqualityNotApplicableImpl( override val operator: String, override val leftType: KtType, override val rightType: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.EqualityNotApplicable(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class EqualityNotApplicableWarningImpl( override val operator: String, override val leftType: KtType, override val rightType: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.EqualityNotApplicableWarning(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class IncompatibleEnumComparisonErrorImpl( override val leftType: KtType, override val rightType: KtType, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.IncompatibleEnumComparisonError(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ToplevelTypealiasesOnlyImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ToplevelTypealiasesOnly(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class RecursiveTypealiasExpansionImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.RecursiveTypealiasExpansion(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class RedundantVisibilityModifierImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.RedundantVisibilityModifier(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class RedundantModalityModifierImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.RedundantModalityModifier(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class RedundantReturnUnitTypeImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.RedundantReturnUnitType(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class RedundantExplicitTypeImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.RedundantExplicitType(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class RedundantSingleExpressionStringTemplateImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.RedundantSingleExpressionStringTemplate(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class CanBeValImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.CanBeVal(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class CanBeReplacedWithOperatorAssignmentImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.CanBeReplacedWithOperatorAssignment(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class RedundantCallOfConversionMethodImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.RedundantCallOfConversionMethod(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ArrayEqualityOperatorCanBeReplacedWithEqualsImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ArrayEqualityOperatorCanBeReplacedWithEquals(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class EmptyRangeImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.EmptyRange(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class RedundantSetterParameterTypeImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.RedundantSetterParameterType(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UnusedVariableImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UnusedVariable(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class AssignedValueIsNeverReadImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.AssignedValueIsNeverRead(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class VariableInitializerIsRedundantImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.VariableInitializerIsRedundant(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class VariableNeverReadImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.VariableNeverRead(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UselessCallOnNotNullImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UselessCallOnNotNull(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ReturnNotAllowedImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ReturnNotAllowed(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ReturnInFunctionWithExpressionBodyImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ReturnInFunctionWithExpressionBody(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class UsageIsNotInlinableImpl( override val parameter: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.UsageIsNotInlinable(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NonLocalReturnNotAllowedImpl( override val parameter: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NonLocalReturnNotAllowed(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class RecursionInInlineImpl( override val symbol: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.RecursionInInline(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class NonPublicCallFromPublicInlineImpl( override val inlineDeclaration: KtSymbol, override val referencedDeclaration: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.NonPublicCallFromPublicInline(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ProtectedConstructorCallFromPublicInlineImpl( override val inlineDeclaration: KtSymbol, override val referencedDeclaration: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ProtectedConstructorCallFromPublicInline(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ProtectedCallFromPublicInlineErrorImpl( override val inlineDeclaration: KtSymbol, override val referencedDeclaration: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ProtectedCallFromPublicInlineError(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ProtectedCallFromPublicInlineImpl( override val inlineDeclaration: KtSymbol, override val referencedDeclaration: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ProtectedCallFromPublicInline(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class PrivateClassMemberFromInlineImpl( override val inlineDeclaration: KtSymbol, override val referencedDeclaration: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.PrivateClassMemberFromInline(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class SuperCallFromPublicInlineImpl( override val symbol: KtSymbol, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.SuperCallFromPublicInline(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class CannotAllUnderImportFromSingletonImpl( override val objectName: Name, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.CannotAllUnderImportFromSingleton(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class PackageCannotBeImportedImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.PackageCannotBeImported(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class CannotBeImportedImpl( override val name: Name, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.CannotBeImported(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ConflictingImportImpl( override val name: Name, - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ConflictingImport(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class OperatorRenamedOnImportImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.OperatorRenamedOnImport(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } internal class ConflictingJvmDeclarationsImpl( - firDiagnostic: FirPsiDiagnostic<*>, + firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, ) : KtFirDiagnostic.ConflictingJvmDeclarations(), KtAbstractFirDiagnostic { - override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) }