Add warnings at declaration and call sites of operator 'mod'

This commit is contained in:
Mikhail Zarechenskiy
2016-12-05 22:43:07 +03:00
parent 97ca51381a
commit 5f71f1bcad
18 changed files with 222 additions and 20 deletions
@@ -3,7 +3,7 @@ class A {
operator fun minusAssign(<!UNUSED_PARAMETER!>x<!>: Int) {}
operator fun timesAssign(<!UNUSED_PARAMETER!>x<!>: Int) {}
operator fun divAssign(<!UNUSED_PARAMETER!>x<!>: Int) {}
operator fun modAssign(<!UNUSED_PARAMETER!>x<!>: Int) {}
operator fun remAssign(<!UNUSED_PARAMETER!>x<!>: Int) {}
}
fun testVal() {
@@ -28,7 +28,7 @@ class B {
operator fun minus(<!UNUSED_PARAMETER!>x<!>: Int): B = B()
operator fun times(<!UNUSED_PARAMETER!>x<!>: Int): B = B()
operator fun div(<!UNUSED_PARAMETER!>x<!>: Int): B = B()
operator fun mod(<!UNUSED_PARAMETER!>x<!>: Int): B = B()
operator fun rem(<!UNUSED_PARAMETER!>x<!>: Int): B = B()
}
fun testWrong() {
@@ -10,8 +10,8 @@ public final class A {
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 minusAssign(/*0*/ x: kotlin.Int): kotlin.Unit
public final operator fun modAssign(/*0*/ x: kotlin.Int): kotlin.Unit
public final operator fun plusAssign(/*0*/ x: kotlin.Int): kotlin.Unit
public final operator fun remAssign(/*0*/ x: kotlin.Int): kotlin.Unit
public final operator fun timesAssign(/*0*/ x: kotlin.Int): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -22,8 +22,8 @@ public final class B {
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(/*0*/ x: kotlin.Int): B
public final operator fun mod(/*0*/ x: kotlin.Int): B
public final operator fun plus(/*0*/ x: kotlin.Int): B
public final operator fun rem(/*0*/ x: kotlin.Int): B
public final operator fun times(/*0*/ x: kotlin.Int): B
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}