Report warning on unary plus()/minus()

This commit is contained in:
Yan Zhulanow
2015-10-12 18:37:28 +03:00
parent 58cbf09232
commit b2470a6aad
16 changed files with 75 additions and 36 deletions
@@ -1,6 +1,6 @@
class A() {
operator infix fun plus(<!UNUSED_PARAMETER!>i<!> : Int) {}
operator fun minus() {}
operator fun unaryMinus() {}
operator infix fun contains(<!UNUSED_PARAMETER!>a<!> : Any?) : Boolean = true
}
@@ -20,8 +20,8 @@ fun test(x : Int?, a : A?) {
a <!UNSAFE_INFIX_CALL!>plus<!> 1
a <!UNSAFE_INFIX_CALL!>+<!> 1
<!UNSAFE_CALL!>-<!>a
a<!UNSAFE_CALL!>.<!>minus()
a?.minus()
a<!UNSAFE_CALL!>.<!>unaryMinus()
a?.unaryMinus()
a<!UNSAFE_CALL!>.<!>div(1)
a <!UNSAFE_INFIX_CALL!>/<!> 1