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
@@ -18,5 +18,5 @@ fun test(a: Any): String {
is A -> q!!
}
// When is not exhaustive
return q
return <!RETURN_TYPE_MISMATCH!>q<!>
}
@@ -18,5 +18,5 @@ fun test(a: Any) {
is A -> q = "1"
}
// When is not exhaustive
return q
return <!RETURN_TYPE_MISMATCH!>q<!>
}
+2 -2
View File
@@ -14,14 +14,14 @@ package test
fun foo(): Int {
val a = "a"
return if (a.length > 0) {
return <!RETURN_TYPE_MISMATCH!>if (a.length > 0) {
when (a) {
"a" -> 1
}
}
else {
3
}
}<!>
}
fun bar(): Int {