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
@@ -9,7 +9,7 @@ public final class A {
public final operator infix fun contains(/*0*/ a: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public final operator fun minus(): kotlin.Unit
public final operator infix fun plus(/*0*/ i: kotlin.Int): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
public final operator fun unaryMinus(): kotlin.Unit
}