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
@@ -15,8 +15,18 @@ operator fun String.unaryPlus(): Int = 0
fun test() {
requireInt(+ "")
requireInt(+ Example())
requireString(+ ExampleDeprecated())
requireString(<!DEPRECATED_UNARY_PLUS_MINUS!>+ ExampleDeprecated()<!>)
}
fun requireInt(n: Int) {}
fun requireString(s: String) {}
fun requireString(s: String) {}
class Example2 {
operator fun plus() = this
operator fun minus() = this
fun test() {
<!DEPRECATED_UNARY_PLUS_MINUS!>+this<!>
<!DEPRECATED_UNARY_PLUS_MINUS!>-this<!>
}
}