FIR: add minor TODO / comments to mismatch checkers

This commit is contained in:
Mikhail Glukhikh
2021-04-13 14:50:27 +03:00
parent b8af3d79d4
commit cc106085e2
2 changed files with 3 additions and 0 deletions
@@ -36,9 +36,11 @@ object FirInitializerTypeMismatchChecker : FirPropertyChecker() {
expressionType.nullability == ConeNullability.NOT_NULL
) {
// val p: Byte = 42 or similar situation
// TODO: remove after fix of KT-46047
return
}
if (propertyType.isExtensionFunctionType || expressionType.isExtensionFunctionType) {
// TODO: remove after fix of KT-45989
return
}
reporter.report(INITIALIZER_TYPE_MISMATCH.on(source, propertyType, expressionType), context)
@@ -24,6 +24,7 @@ object FirFunctionReturnTypeMismatchChecker : FirReturnExpressionChecker() {
val targetElement = expression.target.labeledElement
if (targetElement !is FirSimpleFunction) return
val resultExpression = expression.result
// To avoid duplications with NO_ELSE_IN_WHEN or INVALID_IF_AS_EXPRESSION
if (resultExpression is FirWhenExpression && !resultExpression.isExhaustive) return
val functionReturnType = targetElement.returnTypeRef.coneType