Fix tests: "infix modifier required" and "operator modifier required" errors
This commit is contained in:
+4
-4
@@ -1,10 +1,10 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
fun <T> doSomething(a: T) {}
|
||||
|
||||
fun test() {
|
||||
class Test {
|
||||
fun unaryPlus(): Test = Test()
|
||||
fun plus(a: Test): Test = Test()
|
||||
fun unaryMinus(): Test = Test()
|
||||
operator fun unaryPlus(): Test = Test()
|
||||
operator fun plus(a: Test): Test = Test()
|
||||
operator fun unaryMinus(): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
doSomething((-((test + test).unaryPl<caret>us())).toString())
|
||||
|
||||
Vendored
+4
-4
@@ -1,10 +1,10 @@
|
||||
fun doSomething<T>(a: T) {}
|
||||
fun <T> doSomething(a: T) {}
|
||||
|
||||
fun test() {
|
||||
class Test {
|
||||
fun unaryPlus(): Test = Test()
|
||||
fun plus(a: Test): Test = Test()
|
||||
fun unaryMinus(): Test = Test()
|
||||
operator fun unaryPlus(): Test = Test()
|
||||
operator fun plus(a: Test): Test = Test()
|
||||
operator fun unaryMinus(): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
doSomething((-(+(test + test))).toString())
|
||||
|
||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
fun test() {
|
||||
class Test()
|
||||
|
||||
fun Test.unaryPlus(): Test = Test()
|
||||
operator fun Test.unaryPlus(): Test = Test()
|
||||
|
||||
val test = Test()
|
||||
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.unaryPlus(): Test = Test()
|
||||
operator fun Test.unaryPlus(): Test = Test()
|
||||
|
||||
val test = Test()
|
||||
+test
|
||||
|
||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
// INTENTION_TEXT: Replace with '-' operator
|
||||
fun test() {
|
||||
class Test {
|
||||
fun unaryMinus(): Test = Test()
|
||||
operator fun unaryMinus(): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
test.unaryMin<caret>us()
|
||||
|
||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
// INTENTION_TEXT: Replace with '-' operator
|
||||
fun test() {
|
||||
class Test {
|
||||
fun unaryMinus(): Test = Test()
|
||||
operator fun unaryMinus(): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
-test
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
fun test() {
|
||||
class Test {
|
||||
fun unaryPlus(): Test = Test()
|
||||
operator fun unaryPlus(): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
+test.unaryP<caret>lus()
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
fun test() {
|
||||
class Test {
|
||||
fun unaryPlus(): Test = Test()
|
||||
operator fun unaryPlus(): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
+(+test)
|
||||
|
||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
// INTENTION_TEXT: Replace with '+' operator
|
||||
fun test() {
|
||||
class Test {
|
||||
fun unaryPlus(): Test = Test()
|
||||
operator fun unaryPlus(): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
test.unaryPl<caret>us()
|
||||
|
||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
// INTENTION_TEXT: Replace with '+' operator
|
||||
fun test() {
|
||||
class Test {
|
||||
fun unaryPlus(): Test = Test()
|
||||
operator fun unaryPlus(): Test = Test()
|
||||
}
|
||||
val test = Test()
|
||||
+test
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
class C {
|
||||
companion object {
|
||||
fun unaryMinus(): C = C()
|
||||
operator fun unaryMinus(): C = C()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
class C {
|
||||
companion object {
|
||||
fun unaryMinus(): C = C()
|
||||
operator fun unaryMinus(): C = C()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
open class Base {
|
||||
open fun unaryMinus() = this
|
||||
open operator fun unaryMinus() = this
|
||||
}
|
||||
|
||||
class C : Base() {
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun test() {
|
||||
class Test {
|
||||
fun unaryPlus<T>(): T? = this as? T
|
||||
operator fun <T> unaryPlus(): T? = this as? T
|
||||
}
|
||||
val test = Test()
|
||||
test.unaryP<caret>lus<Int>()
|
||||
|
||||
Reference in New Issue
Block a user