Mark only unreachable parts of element if it has reachable parts

like for 'return todo()' mark only 'return'
This commit is contained in:
Svetlana Isakova
2014-06-11 19:35:00 +04:00
parent 88ecc5cc59
commit 79cec6411d
38 changed files with 597 additions and 84 deletions
@@ -1,3 +1,4 @@
// !DIAGNOSTICS: -UNREACHABLE_CODE
//KT-2445 Calling method with function with generic parameter causes compile-time exception
package a
@@ -7,4 +8,4 @@ fun main(args: Array<String>) {
}
}
fun test<R>(callback: (R) -> Unit):Unit = <!UNREACHABLE_CODE!>callback<!>(null!!)
fun test<R>(callback: (R) -> Unit):Unit = callback(null!!)
@@ -1,3 +1,4 @@
// !DIAGNOSTICS: -UNREACHABLE_CODE
//KT-2838 Type inference failed on passing null as a nullable argument
package a
@@ -9,9 +10,9 @@ fun test(a: Int) {
bar(a, <!NULL_FOR_NONNULL_TYPE!>null<!>)
}
fun test1(a: Int) {
<!UNREACHABLE_CODE!>foo<!>(a, throw Exception())
foo(a, throw Exception())
}
fun test2(a: Int) {
<!UNREACHABLE_CODE!>bar<!>(a, throw Exception())
bar(a, throw Exception())
}