Introduce FirFunctionReturnTypeMismatchChecker

This commit is contained in:
vldf
2021-04-03 22:58:19 +03:00
committed by Mikhail Glukhikh
parent 24f1f1221e
commit 57d2eb5da2
80 changed files with 501 additions and 238 deletions
@@ -12,7 +12,7 @@ fun foo(): String? {
run {
if (true) return@run
if (true) return Obj() // correct error, type check against return type of function "foo"
if (true) return <!RETURN_TYPE_MISMATCH!>Obj()<!> // correct error, type check against return type of function "foo"
}
run {
@@ -23,4 +23,4 @@ fun noCoercionBlockHasExplicitReturn() {
}
}
fun noCoercionInExpressionBody(): Unit = "hello"
fun noCoercionInExpressionBody(): Unit = <!RETURN_TYPE_MISMATCH!>"hello"<!>