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
@@ -149,7 +149,7 @@ fun illegalWhenBody(a: Any): Int = <!NO_ELSE_IN_WHEN!>when<!>(a) {
fun illegalWhenBlock(a: Any): Int {
when(a) {
is Int -> return a
is String -> return a
is String -> return <!RETURN_TYPE_MISMATCH!>a<!>
}
}
fun declarations(a: Any?) {
@@ -222,7 +222,7 @@ fun f(): String {
fun foo(aa: Any?): Int {
var a = aa
if (a is Int?) {
return a
return <!RETURN_TYPE_MISMATCH!>a<!>
}
return 1
}