[FIR] Fix false positive RETURN_TYPE_MISMATCH in intellij ultimate
This commit is contained in:
+1
-1
@@ -37,7 +37,7 @@ fun errorWithLambda(): String {
|
||||
return@foo
|
||||
} foo {
|
||||
bar()
|
||||
return@foo <!RETURN_TYPE_MISMATCH!>10<!>
|
||||
return@foo 10
|
||||
}
|
||||
|
||||
return ""
|
||||
|
||||
+1
-3
@@ -25,9 +25,7 @@ object FirFunctionReturnTypeMismatchChecker : FirReturnExpressionChecker() {
|
||||
override fun check(expression: FirReturnExpression, context: CheckerContext, reporter: DiagnosticReporter) {
|
||||
if (expression.source == null) return
|
||||
val targetElement = expression.target.labeledElement
|
||||
if (targetElement is FirErrorFunction ||
|
||||
targetElement is FirAnonymousFunction && targetElement.isLambda && expression.target.labelName == null
|
||||
) {
|
||||
if (targetElement is FirErrorFunction || targetElement is FirAnonymousFunction && targetElement.isLambda) {
|
||||
return
|
||||
}
|
||||
val resultExpression = expression.result
|
||||
|
||||
Reference in New Issue
Block a user