Report UNUSED_EXPRESSION on anonymous functions

This commit is contained in:
Denis Zharkov
2016-03-23 20:11:51 +03:00
parent 16736e3a0e
commit 628f9050fb
6 changed files with 24 additions and 22 deletions
@@ -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<!>
}