Mark only unreachable parts of element if it has reachable parts
like for 'return todo()' mark only 'return'
This commit is contained in:
+3
-2
@@ -1,3 +1,4 @@
|
||||
// !DIAGNOSTICS: -UNREACHABLE_CODE
|
||||
package kt770_351_735
|
||||
|
||||
|
||||
@@ -120,9 +121,9 @@ fun testStatementInExpressionContext() {
|
||||
val <!UNUSED_VARIABLE!>a1<!>: Unit = <!ASSIGNMENT_IN_EXPRESSION_CONTEXT!>z = <!UNUSED_VALUE!>334<!><!>
|
||||
val <!UNUSED_VARIABLE!>f<!> = <!EXPRESSION_EXPECTED!>for (i in 1..10) {}<!>
|
||||
if (true) return <!ASSIGNMENT_IN_EXPRESSION_CONTEXT!>z = <!UNUSED_VALUE!>34<!><!>
|
||||
<!UNREACHABLE_CODE!>return <!EXPRESSION_EXPECTED!>while (true) {}<!><!>
|
||||
return <!EXPRESSION_EXPECTED!>while (true) {}<!>
|
||||
}
|
||||
|
||||
fun testStatementInExpressionContext2() {
|
||||
<!UNREACHABLE_CODE!>val <!UNUSED_VARIABLE!>a2<!>: Unit = <!EXPRESSION_EXPECTED!>while(true) {}<!><!>
|
||||
val <!UNUSED_VARIABLE!>a2<!>: Unit = <!EXPRESSION_EXPECTED!>while(true) {}<!>
|
||||
}
|
||||
@@ -5,7 +5,7 @@ fun foo() : Int {
|
||||
doSmth()
|
||||
}
|
||||
catch (e: Exception) {
|
||||
<!UNREACHABLE_CODE!>return <!TYPE_MISMATCH!>""<!><!>
|
||||
<!UNREACHABLE_CODE!>return<!> <!TYPE_MISMATCH!>""<!>
|
||||
}
|
||||
finally {
|
||||
return <!TYPE_MISMATCH!>""<!>
|
||||
|
||||
Reference in New Issue
Block a user