Rename unary plus() and minus() to unaryPlus() and unaryMinus()
This commit is contained in:
Vendored
+2
-2
@@ -1,7 +1,7 @@
|
||||
fun test() {
|
||||
class Test {
|
||||
fun plus(vararg a: Int): Test = Test()
|
||||
fun unaryPlus(vararg a: Int): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
test.pl<caret>us()
|
||||
test.unaryPl<caret>us()
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
fun test() {
|
||||
class Test {
|
||||
fun plus(vararg a: Int): Test = Test()
|
||||
fun unaryPlus(vararg a: Int): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
+test
|
||||
|
||||
+3
-3
@@ -2,10 +2,10 @@ fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test() {
|
||||
class Test {
|
||||
fun plus(): Test = Test()
|
||||
fun unaryPlus(): Test = Test()
|
||||
fun plus(a: Test): Test = Test()
|
||||
fun minus(): Test = Test()
|
||||
fun unaryMinus(): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
doSomething((-((test + test).pl<caret>us())).toString())
|
||||
doSomething((-((test + test).unaryPl<caret>us())).toString())
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -2,9 +2,9 @@ fun doSomething<T>(a: T) {}
|
||||
|
||||
fun test() {
|
||||
class Test {
|
||||
fun plus(): Test = Test()
|
||||
fun unaryPlus(): Test = Test()
|
||||
fun plus(a: Test): Test = Test()
|
||||
fun minus(): Test = Test()
|
||||
fun unaryMinus(): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
doSomething((-(+(test + test))).toString())
|
||||
|
||||
Vendored
+2
-2
@@ -1,7 +1,7 @@
|
||||
fun test() {
|
||||
class Test {
|
||||
fun plus(a: Int=1): Test = Test()
|
||||
fun unaryPlus(a: Int=1): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
test.pl<caret>us()
|
||||
test.unaryPl<caret>us()
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
fun test() {
|
||||
class Test {
|
||||
fun plus(a: Int=1): Test = Test()
|
||||
fun unaryPlus(a: Int=1): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
+test
|
||||
|
||||
Vendored
+2
-2
@@ -1,8 +1,8 @@
|
||||
fun test() {
|
||||
class Test()
|
||||
|
||||
fun Test.plus(): Test = Test()
|
||||
fun Test.unaryPlus(): Test = Test()
|
||||
|
||||
val test = Test()
|
||||
test.pl<caret>us()
|
||||
test.unaryPl<caret>us()
|
||||
}
|
||||
|
||||
idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/extensionFunction.kt.after
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
fun test() {
|
||||
class Test()
|
||||
|
||||
fun Test.plus(): Test = Test()
|
||||
fun Test.unaryPlus(): Test = Test()
|
||||
|
||||
val test = Test()
|
||||
+test
|
||||
|
||||
idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/functionLiteralArgument.kt
Vendored
+2
-2
@@ -1,8 +1,8 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun test() {
|
||||
class Test {
|
||||
fun plus(fn: () -> Unit): Test = Test()
|
||||
fun unaryPlus(fn: () -> Unit): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
test.pl<caret>us {}
|
||||
test.unaryPl<caret>us {}
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -1,8 +1,8 @@
|
||||
// INTENTION_TEXT: Replace with '-' operator
|
||||
fun test() {
|
||||
class Test {
|
||||
fun minus(): Test = Test()
|
||||
fun unaryMinus(): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
test.min<caret>us()
|
||||
test.unaryMin<caret>us()
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
// INTENTION_TEXT: Replace with '-' operator
|
||||
fun test() {
|
||||
class Test {
|
||||
fun minus(): Test = Test()
|
||||
fun unaryMinus(): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
-test
|
||||
|
||||
Vendored
+2
-2
@@ -1,8 +1,8 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun test() {
|
||||
class Test {
|
||||
fun plus(a: Int): Test = Test()
|
||||
fun unaryPlus(a: Int): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
test.pl<caret>us(a=1)
|
||||
test.unaryPl<caret>us(a=1)
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
fun test() {
|
||||
class Test {
|
||||
fun plus(): Test = Test()
|
||||
fun unaryPlus(): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
+test.p<caret>lus()
|
||||
+test.unaryP<caret>lus()
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
fun test() {
|
||||
class Test {
|
||||
fun plus(): Test = Test()
|
||||
fun unaryPlus(): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
+(+test)
|
||||
|
||||
Vendored
+2
-2
@@ -1,8 +1,8 @@
|
||||
// INTENTION_TEXT: Replace with '+' operator
|
||||
fun test() {
|
||||
class Test {
|
||||
fun plus(): Test = Test()
|
||||
fun unaryPlus(): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
test.pl<caret>us()
|
||||
test.unaryPl<caret>us()
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
// INTENTION_TEXT: Replace with '+' operator
|
||||
fun test() {
|
||||
class Test {
|
||||
fun plus(): Test = Test()
|
||||
fun unaryPlus(): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
+test
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
class C {
|
||||
companion object {
|
||||
fun minus(): C = C()
|
||||
fun unaryMinus(): C = C()
|
||||
}
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
C.<caret>minus()
|
||||
C.<caret>unaryMinus()
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
class C {
|
||||
companion object {
|
||||
fun minus(): C = C()
|
||||
fun unaryMinus(): C = C()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
open class Base {
|
||||
open fun minus() = this
|
||||
open fun unaryMinus() = this
|
||||
}
|
||||
|
||||
class C : Base() {
|
||||
override fun minus(): Base {
|
||||
return super.<caret>minus()
|
||||
override fun unaryMinus(): Base {
|
||||
return super.<caret>unaryMinus()
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun test() {
|
||||
class Test {
|
||||
fun plus<T>(): T? = this as? T
|
||||
fun unaryPlus<T>(): T? = this as? T
|
||||
}
|
||||
val test = Test()
|
||||
test.p<caret>lus<Int>()
|
||||
test.unaryP<caret>lus<Int>()
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -1,8 +1,8 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun test() {
|
||||
class Test {
|
||||
fun plus(vararg a: Int): Test = Test()
|
||||
fun unaryPlus(vararg a: Int): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
test.pl<caret>us(0)
|
||||
test.unaryPl<caret>us(0)
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun test() {
|
||||
class Test {
|
||||
fun plus(a: Int): Test = Test()
|
||||
fun unaryPlus(a: Int): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
test.pl<caret>us(1)
|
||||
test.unaryPl<caret>us(1)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: false
|
||||
class A(val n: Int) {
|
||||
fun <caret>minus(): A = A(-n)
|
||||
fun <caret>unaryMinus(): A = A(-n)
|
||||
}
|
||||
|
||||
fun test() {
|
||||
|
||||
Reference in New Issue
Block a user