check Nothing type for all expressions not only for calls and simple names
(but excluding statement expressions)
This commit is contained in:
@@ -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() {}
|
||||
@@ -1,3 +1,5 @@
|
||||
// !DIAGNOSTICS: -UNREACHABLE_CODE -UNUSED_PARAMETER
|
||||
// t is unused due to KT-4233
|
||||
trait Tr<T> {
|
||||
var v: T
|
||||
}
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// !DIAGNOSTICS: -UNREACHABLE_CODE
|
||||
trait Tr<T> {
|
||||
var v: T
|
||||
}
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// !DIAGNOSTICS: -UNREACHABLE_CODE
|
||||
trait Tr<T> {
|
||||
var v: T
|
||||
}
|
||||
|
||||
@@ -7,4 +7,5 @@ fun main(args: Array<String>) {
|
||||
}
|
||||
}
|
||||
|
||||
fun test<R>(callback: (R) -> Unit):Unit = callback(null!!)
|
||||
// callback is unused due to KT-4233
|
||||
fun test<R>(<!UNUSED_PARAMETER!>callback<!>: (R) -> Unit):Unit = <!UNREACHABLE_CODE!>callback(null!!)<!>
|
||||
Reference in New Issue
Block a user