check Nothing type for all expressions not only for calls and simple names

(but excluding statement expressions)
This commit is contained in:
svtk
2013-11-19 13:10:39 +04:00
parent 36ce8f24b3
commit c1ec8cbde9
7 changed files with 57 additions and 29 deletions
@@ -0,0 +1,23 @@
package c
fun test1() {
<!UNREACHABLE_CODE!>val <!UNUSED_VARIABLE!>r<!>: Nothing = null!!<!>
}
fun test2(a: A) {
a + a
<!UNREACHABLE_CODE!>bar()<!>
}
fun test3() {
null!!
<!UNREACHABLE_CODE!>bar()<!>
}
fun throwNPE() = null!!
class A {
fun plus(<!UNUSED_PARAMETER!>a<!>: A): Nothing = throw Exception()
}
fun bar() {}