[FIR] Remove redundant INITIALIZER_TYPE_MISMATCH introduced earlier
This commit is contained in:
committed by
Space Team
parent
389f02b016
commit
fdb2b714c9
+2
-1
@@ -13,11 +13,12 @@ import org.jetbrains.kotlin.fir.analysis.checkers.checkTypeMismatch
|
||||
import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext
|
||||
import org.jetbrains.kotlin.fir.declarations.FirProperty
|
||||
import org.jetbrains.kotlin.fir.expressions.FirComponentCall
|
||||
import org.jetbrains.kotlin.fir.expressions.FirErrorExpression
|
||||
import org.jetbrains.kotlin.fir.types.coneType
|
||||
|
||||
object FirInitializerTypeMismatchChecker : FirPropertyChecker(MppCheckerKind.Common) {
|
||||
override fun check(declaration: FirProperty, context: CheckerContext, reporter: DiagnosticReporter) {
|
||||
val initializer = declaration.initializer ?: return
|
||||
val initializer = declaration.initializer?.takeIf { it !is FirErrorExpression } ?: return
|
||||
val source = declaration.source ?: return
|
||||
if (source.elementType == KtNodeTypes.DESTRUCTURING_DECLARATION) return
|
||||
if (initializer is FirComponentCall) return
|
||||
|
||||
+2
-1
@@ -10,11 +10,12 @@ import org.jetbrains.kotlin.fir.analysis.checkers.MppCheckerKind
|
||||
import org.jetbrains.kotlin.fir.analysis.checkers.checkTypeMismatch
|
||||
import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext
|
||||
import org.jetbrains.kotlin.fir.declarations.FirValueParameter
|
||||
import org.jetbrains.kotlin.fir.expressions.FirErrorExpression
|
||||
import org.jetbrains.kotlin.fir.types.coneType
|
||||
|
||||
object FirValueParameterDefaultValueTypeMismatchChecker : FirValueParameterChecker(MppCheckerKind.Common) {
|
||||
override fun check(declaration: FirValueParameter, context: CheckerContext, reporter: DiagnosticReporter) {
|
||||
val defaultValue = declaration.defaultValue ?: return
|
||||
val defaultValue = declaration.defaultValue?.takeIf { it !is FirErrorExpression } ?: return
|
||||
val source = requireNotNull(declaration.source)
|
||||
val parameterType = declaration.returnTypeRef.coneType
|
||||
|
||||
|
||||
Reference in New Issue
Block a user