KT-1002 If there's no return in function highlight only last token but not last statement

This commit is contained in:
Svetlana Isakova
2012-03-09 12:20:10 +04:00
parent 1054a4da9a
commit c857785910
11 changed files with 93 additions and 67 deletions
@@ -5,11 +5,11 @@ fun foo() : Int {
val d = 2
var z = 0
when(d) {
is 5, is 3 -> <!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY, UNUSED_CHANGED_VALUE!>z++<!>
<!ELSE_MISPLACED_IN_WHEN!>else<!> -> { <!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>z = <!UNUSED_VALUE!>-1000<!><!> }
is 5, is 3 -> <!UNUSED_CHANGED_VALUE!>z++<!>
<!ELSE_MISPLACED_IN_WHEN!>else<!> -> { z = <!UNUSED_VALUE!>-1000<!> }
<!UNREACHABLE_CODE!>return z -> 34<!>
}
}
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
//test unreachable code
fun fff(): Int {