Report UNUSED_EXPRESSION on anonymous functions
This commit is contained in:
+4
-4
@@ -18,9 +18,9 @@ class Outer {
|
||||
}
|
||||
|
||||
fun outerFun() {
|
||||
fun () {}
|
||||
fun B.() {}
|
||||
<!UNUSED_EXPRESSION!>fun () {}<!>
|
||||
<!UNUSED_EXPRESSION!>fun B.() {}<!>
|
||||
|
||||
@a fun () {}
|
||||
fun @a A.() {}
|
||||
<!UNUSED_EXPRESSION!>@a fun () {}<!>
|
||||
<!UNUSED_EXPRESSION!>fun @a A.() {}<!>
|
||||
}
|
||||
Vendored
+8
-8
@@ -1,21 +1,21 @@
|
||||
fun unusedExpressions() {
|
||||
if (1 == 1)
|
||||
fun(): Int {return 1}
|
||||
<!UNUSED_EXPRESSION!>fun(): Int {return 1}<!>
|
||||
else
|
||||
fun() = 1
|
||||
<!UNUSED_EXPRESSION!>fun() = 1<!>
|
||||
|
||||
if (1 == 1) {
|
||||
fun(): Int {
|
||||
<!UNUSED_EXPRESSION!>fun(): Int {
|
||||
return 1
|
||||
}
|
||||
}<!>
|
||||
}
|
||||
else
|
||||
fun() = 1
|
||||
<!UNUSED_EXPRESSION!>fun() = 1<!>
|
||||
|
||||
when (1) {
|
||||
0 -> fun(): Int {return 1}
|
||||
else -> fun() = 1
|
||||
0 -> <!UNUSED_EXPRESSION!>fun(): Int {return 1}<!>
|
||||
else -> <!UNUSED_EXPRESSION!>fun() = 1<!>
|
||||
}
|
||||
|
||||
fun() = 1
|
||||
<!UNUSED_EXPRESSION!>fun() = 1<!>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user