Rename unary plus() and minus() to unaryPlus() and unaryMinus()

This commit is contained in:
Yan Zhulanow
2015-10-07 19:25:32 +03:00
parent 1f2b4e20fe
commit ed5c059cea
59 changed files with 210 additions and 88 deletions
@@ -0,0 +1,22 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
class Example {
operator fun plus(): String = ""
operator fun unaryPlus(): Int = 0
}
class ExampleDeprecated {
operator fun plus(): String = ""
}
operator fun String.plus(): String = this
operator fun String.unaryPlus(): Int = 0
fun test() {
requireInt(+ "")
requireInt(+ Example())
requireString(+ ExampleDeprecated())
}
fun requireInt(n: Int) {}
fun requireString(s: String) {}