Do not report IMPLICIT_CAST_TO_ANY on last statement of lambda with Unit(?) in at least one branch.
This commit is contained in:
@@ -14,9 +14,19 @@ fun test1(word: String) =
|
||||
fun test2(word: String) =
|
||||
run {
|
||||
if (word.length > 4) {
|
||||
<!INVALID_IF_AS_EXPRESSION, IMPLICIT_CAST_TO_ANY!>if (word.startsWith("a")) longWords++<!>
|
||||
<!INVALID_IF_AS_EXPRESSION!>if (word.startsWith("a")) <!IMPLICIT_CAST_TO_ANY!>longWords++<!><!>
|
||||
}
|
||||
else {
|
||||
<!IMPLICIT_CAST_TO_ANY!>smallWords.add(word)<!>
|
||||
}
|
||||
}
|
||||
|
||||
fun test3(word: String) =
|
||||
run {
|
||||
if (word.length > 4) {
|
||||
longWords++
|
||||
}
|
||||
else {
|
||||
System.out?.println(word) // Unit?
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user