diff --git a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java
index a4efd9dcb9a1..5ad3af3c0c76 100644
--- a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java
+++ b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java
@@ -7759,12 +7759,6 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
doTest(fileName);
}
- @TestMetadata("compareTo.kt")
- public void testCompareTo() throws Exception {
- String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/swapBinaryExpression/compareTo.kt");
- doTest(fileName);
- }
-
@TestMetadata("conjunction.kt")
public void testConjunction() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/swapBinaryExpression/conjunction.kt");
@@ -7801,24 +7795,12 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
doTest(fileName);
}
- @TestMetadata("divideLiteral.kt")
- public void testDivideLiteral() throws Exception {
- String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/swapBinaryExpression/divideLiteral.kt");
- doTest(fileName);
- }
-
@TestMetadata("equals.kt")
public void testEquals() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/swapBinaryExpression/equals.kt");
doTest(fileName);
}
- @TestMetadata("equalsLiteral.kt")
- public void testEqualsLiteral() throws Exception {
- String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/swapBinaryExpression/equalsLiteral.kt");
- doTest(fileName);
- }
-
@TestMetadata("greaterThan.kt")
public void testGreaterThan() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/swapBinaryExpression/greaterThan.kt");
@@ -7837,12 +7819,6 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
doTest(fileName);
}
- @TestMetadata("identityEqualsLiteral.kt")
- public void testIdentityEqualsLiteral() throws Exception {
- String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/swapBinaryExpression/identityEqualsLiteral.kt");
- doTest(fileName);
- }
-
@TestMetadata("in.kt")
public void testIn() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/swapBinaryExpression/in.kt");
@@ -7885,12 +7861,6 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
doTest(fileName);
}
- @TestMetadata("minusLiteral.kt")
- public void testMinusLiteral() throws Exception {
- String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/swapBinaryExpression/minusLiteral.kt");
- doTest(fileName);
- }
-
@TestMetadata("multipleOperands.kt")
public void testMultipleOperands() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/swapBinaryExpression/multipleOperands.kt");
@@ -7999,12 +7969,6 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
doTest(fileName);
}
- @TestMetadata("plusLiteral.kt")
- public void testPlusLiteral() throws Exception {
- String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/swapBinaryExpression/plusLiteral.kt");
- doTest(fileName);
- }
-
@TestMetadata("plusMinus.kt")
public void testPlusMinus() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/swapBinaryExpression/plusMinus.kt");
@@ -8017,12 +7981,6 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
doTest(fileName);
}
- @TestMetadata("rangeToLiteral.kt")
- public void testRangeToLiteral() throws Exception {
- String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/swapBinaryExpression/rangeToLiteral.kt");
- doTest(fileName);
- }
-
@TestMetadata("remainder.kt")
public void testRemainder() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/swapBinaryExpression/remainder.kt");
@@ -8047,12 +8005,6 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
doTest(fileName);
}
- @TestMetadata("timesLiteral.kt")
- public void testTimesLiteral() throws Exception {
- String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/swapBinaryExpression/timesLiteral.kt");
- doTest(fileName);
- }
-
@TestMetadata("xor.kt")
public void testXor() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/swapBinaryExpression/xor.kt");
diff --git a/plugins/kotlin/idea/tests/testData/codeInsight/lineMarker/recursiveCall/conventionCall.kt b/plugins/kotlin/idea/tests/testData/codeInsight/lineMarker/recursiveCall/conventionCall.kt
index e26b22b46017..282f2b8b30dc 100644
--- a/plugins/kotlin/idea/tests/testData/codeInsight/lineMarker/recursiveCall/conventionCall.kt
+++ b/plugins/kotlin/idea/tests/testData/codeInsight/lineMarker/recursiveCall/conventionCall.kt
@@ -1,4 +1,4 @@
-fun Any.get(a: Int) {
+operator fun Any.get(a: Int) {
if (a > 0) {
this[a - 1]
}
@@ -10,32 +10,32 @@ class A {
return true
}
- fun inc(): A {
+ operator fun inc(): A {
this++
++this
return this
}
- fun component1(): Int {
+ operator fun component1(): Int {
// TODO: should be recursion marker too
val (a) = this
return 1
}
- fun unaryPlus() {
+ operator fun unaryPlus() {
+this
}
- fun unaryMinus() {
+ operator fun unaryMinus() {
-this
}
- fun plus(a: Int) {
+ operator fun plus(a: Int) {
this + 1
this += 1
}
- fun invoke() {
+ operator fun invoke() {
val a = A()
a()
a.invoke()
@@ -46,7 +46,7 @@ class A {
}
class B
-fun B.invoke() {
+operator fun B.invoke() {
this()
invoke()
}
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/compiler/loadJava/compiledKotlin/annotations/classMembers/DelegatedProperty.kt b/plugins/kotlin/idea/tests/testData/compiler/loadJava/compiledKotlin/annotations/classMembers/DelegatedProperty.kt
index 27d124fb4f37..d16b85917050 100644
--- a/plugins/kotlin/idea/tests/testData/compiler/loadJava/compiledKotlin/annotations/classMembers/DelegatedProperty.kt
+++ b/plugins/kotlin/idea/tests/testData/compiler/loadJava/compiledKotlin/annotations/classMembers/DelegatedProperty.kt
@@ -6,6 +6,6 @@ annotation class Anno
class Class {
@Anno val x: Int by object {
- fun getValue(thiz: Class, data: KProperty<*>) = null!!
+ operator fun getValue(thiz: Class, data: KProperty<*>) = null!!
}
}
diff --git a/plugins/kotlin/idea/tests/testData/compiler/loadJava/compiledKotlin/annotations/packageMembers/DelegatedProperty.kt b/plugins/kotlin/idea/tests/testData/compiler/loadJava/compiledKotlin/annotations/packageMembers/DelegatedProperty.kt
index 32944f1998e7..0662beba5609 100644
--- a/plugins/kotlin/idea/tests/testData/compiler/loadJava/compiledKotlin/annotations/packageMembers/DelegatedProperty.kt
+++ b/plugins/kotlin/idea/tests/testData/compiler/loadJava/compiledKotlin/annotations/packageMembers/DelegatedProperty.kt
@@ -5,5 +5,5 @@ import kotlin.reflect.KProperty
annotation class Anno
@Anno val x: Int by object {
- fun getValue(thiz: Any?, data: KProperty<*>) = null!!
+ operator fun getValue(thiz: Any?, data: KProperty<*>) = null!!
}
diff --git a/plugins/kotlin/idea/tests/testData/compiler/loadJava/compiledKotlin/fromLoadJava/library/Max.kt b/plugins/kotlin/idea/tests/testData/compiler/loadJava/compiledKotlin/fromLoadJava/library/Max.kt
index 4c4fce88b503..2fd2ec91aac6 100644
--- a/plugins/kotlin/idea/tests/testData/compiler/loadJava/compiledKotlin/fromLoadJava/library/Max.kt
+++ b/plugins/kotlin/idea/tests/testData/compiler/loadJava/compiledKotlin/fromLoadJava/library/Max.kt
@@ -1,7 +1,7 @@
package test
public open class Max {
- public open fun max(p0 : Collection?): T? where T : Comparable? {
+ public open fun max(p0 : Collection?): T? where T : Comparable? {
throw UnsupportedOperationException()
}
}
diff --git a/plugins/kotlin/idea/tests/testData/compiler/loadJava/compiledKotlin/prop/VarWithDelegated.kt b/plugins/kotlin/idea/tests/testData/compiler/loadJava/compiledKotlin/prop/VarWithDelegated.kt
index 83754b6bf3a0..19b04a271a42 100644
--- a/plugins/kotlin/idea/tests/testData/compiler/loadJava/compiledKotlin/prop/VarWithDelegated.kt
+++ b/plugins/kotlin/idea/tests/testData/compiler/loadJava/compiledKotlin/prop/VarWithDelegated.kt
@@ -8,6 +8,6 @@ class A {
}
class MyProperty {
- fun getValue(t: T, p: KProperty<*>): Int = 42
- fun setValue(t: T, p: KProperty<*>, i: Int) {}
+ operator fun getValue(t: T, p: KProperty<*>): Int = 42
+ operator fun setValue(t: T, p: KProperty<*>, i: Int) {}
}
diff --git a/plugins/kotlin/idea/tests/testData/compiler/loadJava/compiledKotlin/prop/VarWithDelegated.txt b/plugins/kotlin/idea/tests/testData/compiler/loadJava/compiledKotlin/prop/VarWithDelegated.txt
index 1bd8ea99ba27..e818aeff9cbb 100644
--- a/plugins/kotlin/idea/tests/testData/compiler/loadJava/compiledKotlin/prop/VarWithDelegated.txt
+++ b/plugins/kotlin/idea/tests/testData/compiler/loadJava/compiledKotlin/prop/VarWithDelegated.txt
@@ -9,6 +9,6 @@ public final class A {
public final class MyProperty*0*/ T> {
/*primary*/ public constructor MyProperty*0*/ T>()
- public final fun getValue(/*0*/ t: T, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.Int
- public final fun setValue(/*0*/ t: T, /*1*/ p: kotlin.reflect.KProperty<*>, /*2*/ i: kotlin.Int): kotlin.Unit
+ public final operator fun getValue(/*0*/ t: T, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.Int
+ public final operator fun setValue(/*0*/ t: T, /*1*/ p: kotlin.reflect.KProperty<*>, /*2*/ i: kotlin.Int): kotlin.Unit
}
diff --git a/plugins/kotlin/idea/tests/testData/copyPaste/imports/ExtensionAsInfixOrOperator.kt b/plugins/kotlin/idea/tests/testData/copyPaste/imports/ExtensionAsInfixOrOperator.kt
index 318b6c0e73fe..a467880ee82e 100644
--- a/plugins/kotlin/idea/tests/testData/copyPaste/imports/ExtensionAsInfixOrOperator.kt
+++ b/plugins/kotlin/idea/tests/testData/copyPaste/imports/ExtensionAsInfixOrOperator.kt
@@ -2,9 +2,9 @@ package a
class A() {}
-fun A.plus(a: A) = this
+operator fun A.plus(a: A) = this
-fun A.infix(i: Int) = i
+infix fun A.infix(i: Int) = i
fun f(a: A) {
a + a
diff --git a/plugins/kotlin/idea/tests/testData/copyPaste/imports/ExtensionConflict.expected.kt b/plugins/kotlin/idea/tests/testData/copyPaste/imports/ExtensionConflict.expected.kt
index 5a39e1b6097c..4f5016950652 100644
--- a/plugins/kotlin/idea/tests/testData/copyPaste/imports/ExtensionConflict.expected.kt
+++ b/plugins/kotlin/idea/tests/testData/copyPaste/imports/ExtensionConflict.expected.kt
@@ -1,27 +1,27 @@
// ERROR: Overload resolution ambiguity: public fun a.A.ext(): kotlin.Unit defined in a public fun a.A.ext(): kotlin.Unit defined in to
-// ERROR: Overload resolution ambiguity: public fun a.A.plus(a: a.A): kotlin.Unit defined in a public fun a.A.plus(a: a.A): kotlin.Unit defined in to
-// ERROR: Overload resolution ambiguity: public fun a.A.infix(a: a.A): kotlin.Unit defined in a public fun a.A.infix(a: a.A): kotlin.Unit defined in to
-// ERROR: Overload resolution ambiguity: public fun a.A.minus(): kotlin.Unit defined in a public fun a.A.minus(): kotlin.Unit defined in to
+// ERROR: Overload resolution ambiguity: public operator fun a.A.plus(a: a.A): kotlin.Unit defined in a public operator fun a.A.plus(a: a.A): kotlin.Unit defined in to
+// ERROR: Overload resolution ambiguity: public infix fun a.A.infix(a: a.A): kotlin.Unit defined in a public infix fun a.A.infix(a: a.A): kotlin.Unit defined in to
+// ERROR: Overload resolution ambiguity: public operator fun a.A.unaryMinus(): kotlin.Unit defined in a public operator fun a.A.unaryMinus(): kotlin.Unit defined in to
// ERROR: Overload resolution ambiguity: public val a.A.p: kotlin.Int defined in a public val a.A.p: kotlin.Int defined in to
package to
import a.A
import a.ext
import a.infix
-import a.minus
import a.p
import a.plus
+import a.unaryMinus
fun A.ext() {
}
-fun A.infix(a: A) {
+infix fun A.infix(a: A) {
}
-fun A.plus(a: A) {
+operator fun A.plus(a: A) {
}
-fun A.minus() {
+operator fun A.unaryMinus() {
}
val A.p: Int
diff --git a/plugins/kotlin/idea/tests/testData/copyPaste/imports/ExtensionConflict.expected.names b/plugins/kotlin/idea/tests/testData/copyPaste/imports/ExtensionConflict.expected.names
index f514a914fd72..7c547955e7c2 100644
--- a/plugins/kotlin/idea/tests/testData/copyPaste/imports/ExtensionConflict.expected.names
+++ b/plugins/kotlin/idea/tests/testData/copyPaste/imports/ExtensionConflict.expected.names
@@ -1,5 +1,5 @@
a.ext
a.infix
-a.minus
a.p
a.plus
+a.unaryMinus
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/copyPaste/imports/ExtensionConflict.kt b/plugins/kotlin/idea/tests/testData/copyPaste/imports/ExtensionConflict.kt
index d239c2c1253f..5305d66b1aef 100644
--- a/plugins/kotlin/idea/tests/testData/copyPaste/imports/ExtensionConflict.kt
+++ b/plugins/kotlin/idea/tests/testData/copyPaste/imports/ExtensionConflict.kt
@@ -6,13 +6,13 @@ class A {
fun A.ext() {
}
-fun A.infix(a: A) {
+infix fun A.infix(a: A) {
}
-fun A.plus(a: A) {
+operator fun A.plus(a: A) {
}
-fun A.minus() {
+operator fun A.unaryMinus() {
}
val A.p: Int
diff --git a/plugins/kotlin/idea/tests/testData/copyPaste/imports/ExtensionConflict.to.kt b/plugins/kotlin/idea/tests/testData/copyPaste/imports/ExtensionConflict.to.kt
index 44bd3a2b05a4..ef90af76c222 100644
--- a/plugins/kotlin/idea/tests/testData/copyPaste/imports/ExtensionConflict.to.kt
+++ b/plugins/kotlin/idea/tests/testData/copyPaste/imports/ExtensionConflict.to.kt
@@ -5,13 +5,13 @@ import a.A
fun A.ext() {
}
-fun A.infix(a: A) {
+infix fun A.infix(a: A) {
}
-fun A.plus(a: A) {
+operator fun A.plus(a: A) {
}
-fun A.minus() {
+operator fun A.unaryMinus() {
}
val A.p: Int
diff --git a/plugins/kotlin/idea/tests/testData/copyPaste/imports/ForLoop.kt b/plugins/kotlin/idea/tests/testData/copyPaste/imports/ForLoop.kt
index dd8602b59574..850a47aa5f2d 100644
--- a/plugins/kotlin/idea/tests/testData/copyPaste/imports/ForLoop.kt
+++ b/plugins/kotlin/idea/tests/testData/copyPaste/imports/ForLoop.kt
@@ -6,11 +6,11 @@ class A() {
class B() {
}
-fun B.next(): Int = 3
+operator fun B.next(): Int = 3
-fun B.hasNext(): Boolean = false
+operator fun B.hasNext(): Boolean = false
-fun A.iterator() = B()
+operator fun A.iterator() = B()
fun f() {
for (i in A()) {
diff --git a/plugins/kotlin/idea/tests/testData/copyPaste/imports/GetExpression.kt b/plugins/kotlin/idea/tests/testData/copyPaste/imports/GetExpression.kt
index 74683ce855a2..bfe6a4f95531 100644
--- a/plugins/kotlin/idea/tests/testData/copyPaste/imports/GetExpression.kt
+++ b/plugins/kotlin/idea/tests/testData/copyPaste/imports/GetExpression.kt
@@ -3,7 +3,7 @@ package a
class A {
}
-fun A.get(s: String) {
+operator fun A.get(s: String) {
}
fun f() {
diff --git a/plugins/kotlin/idea/tests/testData/copyPaste/imports/Invoke.kt b/plugins/kotlin/idea/tests/testData/copyPaste/imports/Invoke.kt
index e69811560530..1e3761d5392e 100644
--- a/plugins/kotlin/idea/tests/testData/copyPaste/imports/Invoke.kt
+++ b/plugins/kotlin/idea/tests/testData/copyPaste/imports/Invoke.kt
@@ -3,7 +3,7 @@ package a
class A {
}
-fun A.invoke() {
+operator fun A.invoke() {
}
fun f(a: A) {
diff --git a/plugins/kotlin/idea/tests/testData/copyPaste/imports/MultiDeclaration.kt b/plugins/kotlin/idea/tests/testData/copyPaste/imports/MultiDeclaration.kt
index b7c730c73c2d..e00832fb17bb 100644
--- a/plugins/kotlin/idea/tests/testData/copyPaste/imports/MultiDeclaration.kt
+++ b/plugins/kotlin/idea/tests/testData/copyPaste/imports/MultiDeclaration.kt
@@ -3,8 +3,8 @@ package a
class A() {
}
-fun A.component1() = 1
-fun A.component2() = 2
+operator fun A.component1() = 1
+operator fun A.component2() = 2
fun f() {
val (a, b) = A()
diff --git a/plugins/kotlin/idea/tests/testData/copyPaste/imports/MultiReferencePartiallyCopied.expected.kt b/plugins/kotlin/idea/tests/testData/copyPaste/imports/MultiReferencePartiallyCopied.expected.kt
index 20f33e8a6112..2900af082f9d 100644
--- a/plugins/kotlin/idea/tests/testData/copyPaste/imports/MultiReferencePartiallyCopied.expected.kt
+++ b/plugins/kotlin/idea/tests/testData/copyPaste/imports/MultiReferencePartiallyCopied.expected.kt
@@ -5,7 +5,7 @@ import a.B
import a.hasNext
import a.next
-fun A.iterator() = B()
+operator fun A.iterator() = B()
fun f() {
for (i in A()) {
diff --git a/plugins/kotlin/idea/tests/testData/copyPaste/imports/MultiReferencePartiallyCopied.kt b/plugins/kotlin/idea/tests/testData/copyPaste/imports/MultiReferencePartiallyCopied.kt
index 6053b8a6122e..cca948a98e5a 100644
--- a/plugins/kotlin/idea/tests/testData/copyPaste/imports/MultiReferencePartiallyCopied.kt
+++ b/plugins/kotlin/idea/tests/testData/copyPaste/imports/MultiReferencePartiallyCopied.kt
@@ -6,11 +6,11 @@ class A() {
class B() {
}
-fun B.next(): Int = 3
+operator fun B.next(): Int = 3
-fun B.hasNext(): Boolean = false
+operator fun B.hasNext(): Boolean = false
-fun A.iterator() = B()
+operator fun A.iterator() = B()
fun f() {
for (i in A()) {
diff --git a/plugins/kotlin/idea/tests/testData/debugger/smartStepInto/unary.kt b/plugins/kotlin/idea/tests/testData/debugger/smartStepInto/unary.kt
index 34b4f9af166e..a6d49cde3d2a 100644
--- a/plugins/kotlin/idea/tests/testData/debugger/smartStepInto/unary.kt
+++ b/plugins/kotlin/idea/tests/testData/debugger/smartStepInto/unary.kt
@@ -1,9 +1,9 @@
class A {
- fun plus() {}
- fun minus() {}
+ operator fun unaryPlus() {}
+ operator fun unaryMinus() {}
}
fun foo() {
- +A() || A()-
+ +A() || -A()
}
-// EXISTS: plus(), minus()
\ No newline at end of file
+// EXISTS: unaryPlus(), unaryMinus()
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/debugger/tinyApp/outs/delegatedPropertyInClass.out b/plugins/kotlin/idea/tests/testData/debugger/tinyApp/outs/delegatedPropertyInClass.out
index 6d0ab104f851..af8f4630fc50 100644
--- a/plugins/kotlin/idea/tests/testData/debugger/tinyApp/outs/delegatedPropertyInClass.out
+++ b/plugins/kotlin/idea/tests/testData/debugger/tinyApp/outs/delegatedPropertyInClass.out
@@ -19,11 +19,11 @@ class A {
}
class MyDelegate {
- fun getValue(t: Any?, p: KProperty<*>): Int = 1
+ operator fun getValue(t: Any?, p: KProperty<*>): Int = 1
}
class MyDelegateThrowsException {
- fun getValue(t: Any?, p: KProperty<*>): Int = throw IllegalStateException()
+ operator fun getValue(t: Any?, p: KProperty<*>): Int = throw IllegalStateException()
}
// PRINT_FRAME
diff --git a/plugins/kotlin/idea/tests/testData/debugger/tinyApp/outs/delegatedPropertyInClassWoRenderer.out b/plugins/kotlin/idea/tests/testData/debugger/tinyApp/outs/delegatedPropertyInClassWoRenderer.out
index f82f11c5ce91..06d5c30a4693 100644
--- a/plugins/kotlin/idea/tests/testData/debugger/tinyApp/outs/delegatedPropertyInClassWoRenderer.out
+++ b/plugins/kotlin/idea/tests/testData/debugger/tinyApp/outs/delegatedPropertyInClassWoRenderer.out
@@ -18,7 +18,7 @@ class A {
}
class MyDelegate {
- fun getValue(t: Any?, p: KProperty<*>): Int = 1
+ operator fun getValue(t: Any?, p: KProperty<*>): Int = 1
}
// RENDER_DELEGATED_PROPERTIES: false
diff --git a/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/withoutBodyTypeParameters.kt b/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/withoutBodyTypeParameters.kt
index b68a4cf777a6..af0d05f3483b 100644
--- a/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/withoutBodyTypeParameters.kt
+++ b/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/withoutBodyTypeParameters.kt
@@ -5,7 +5,7 @@ import kotlin.properties.Delegates
// EXPRESSION: i
// RESULT: instance of java.lang.Integer(id=ID): Ljava/lang/Integer;
//Breakpoint!
-fun foo(i: T) = i
+fun foo(i: T) = i
fun run(i: () -> Int) = 1
diff --git a/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/dependentOnFile.kt b/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/dependentOnFile.kt
index 6135f2bbb64a..5e107fbca518 100644
--- a/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/dependentOnFile.kt
+++ b/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/dependentOnFile.kt
@@ -27,7 +27,7 @@ val Int.testExtVal: Int get() = 1
val testDelVal by Delegate()
class Delegate {
- fun getValue(a: Any?, b: KProperty<*>) = 1
+ operator fun getValue(a: Any?, b: KProperty<*>) = 1
}
// EXPRESSION: TestClass().testFun()
diff --git a/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/extractVariablesFromCall.kt b/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/extractVariablesFromCall.kt
index 5d2a18a1a535..e4acae7f27ea 100644
--- a/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/extractVariablesFromCall.kt
+++ b/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/extractVariablesFromCall.kt
@@ -9,7 +9,7 @@ fun main(args: Array) {
}
fun f1(i: Int, s: String) = i + s.length()
-fun Int.f2(s: String) = this + s.length()
+infix fun Int.f2(s: String) = this + s.length()
class MyClass {
fun f1(i: Int, s: String) = i + s.length()
diff --git a/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/delegatedPropertyInClass.kt b/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/delegatedPropertyInClass.kt
index b2a9bdfeb52a..2a45266131ed 100644
--- a/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/delegatedPropertyInClass.kt
+++ b/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/delegatedPropertyInClass.kt
@@ -15,11 +15,11 @@ class A {
}
class MyDelegate {
- fun getValue(t: Any?, p: KProperty<*>): Int = 1
+ operator fun getValue(t: Any?, p: KProperty<*>): Int = 1
}
class MyDelegateThrowsException {
- fun getValue(t: Any?, p: KProperty<*>): Int = throw IllegalStateException()
+ operator fun getValue(t: Any?, p: KProperty<*>): Int = throw IllegalStateException()
}
// PRINT_FRAME
diff --git a/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/delegatedPropertyInClassWoRenderer.kt b/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/delegatedPropertyInClassWoRenderer.kt
index 5be6497a9b82..8a0864bd90e0 100644
--- a/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/delegatedPropertyInClassWoRenderer.kt
+++ b/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/delegatedPropertyInClassWoRenderer.kt
@@ -14,7 +14,7 @@ class A {
}
class MyDelegate {
- fun getValue(t: Any?, p: KProperty<*>): Int = 1
+ operator fun getValue(t: Any?, p: KProperty<*>): Int = 1
}
// RENDER_DELEGATED_PROPERTIES: false
diff --git a/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/typeParameterRef.kt b/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/typeParameterRef.kt
index 416343cecd92..10ce2bea09d1 100644
--- a/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/typeParameterRef.kt
+++ b/plugins/kotlin/idea/tests/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/typeParameterRef.kt
@@ -4,11 +4,11 @@ fun main(args: Array) {
test()
}
-fun foo(): Int {
+fun foo(): Int {
return 1
}
-fun test() {
+fun test() {
//Breakpoint!
val a = foo()
}
diff --git a/plugins/kotlin/idea/tests/testData/findUsages/kotlin/conventions/unaryMinus.0.kt b/plugins/kotlin/idea/tests/testData/findUsages/kotlin/conventions/unaryMinus.0.kt
index c10d2b4e499b..92af03bdca23 100644
--- a/plugins/kotlin/idea/tests/testData/findUsages/kotlin/conventions/unaryMinus.0.kt
+++ b/plugins/kotlin/idea/tests/testData/findUsages/kotlin/conventions/unaryMinus.0.kt
@@ -2,10 +2,10 @@
// OPTIONS: usages
class A(val n: Int) {
- fun minus(): A = this
+ operator fun unaryMinus(): A = this
}
fun test() {
- A(1).minus()
+ A(1).unaryMinus()
-A(1)
}
diff --git a/plugins/kotlin/idea/tests/testData/findUsages/kotlin/conventions/unaryMinus.results.txt b/plugins/kotlin/idea/tests/testData/findUsages/kotlin/conventions/unaryMinus.results.txt
index f38ad70bc7eb..706b8ce92ea2 100644
--- a/plugins/kotlin/idea/tests/testData/findUsages/kotlin/conventions/unaryMinus.results.txt
+++ b/plugins/kotlin/idea/tests/testData/findUsages/kotlin/conventions/unaryMinus.results.txt
@@ -1,2 +1,2 @@
Function call (10: 5) -A(1)
-Function call (9: 10) A(1).minus()
\ No newline at end of file
+Function call (9: 10) A(1).unaryMinus()
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/intentions/branched/ifThenToDoubleBang/conditionInvalidBinaryExp.kt b/plugins/kotlin/idea/tests/testData/intentions/branched/ifThenToDoubleBang/conditionInvalidBinaryExp.kt
index 8822e66b74b3..4e93e95c323f 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/branched/ifThenToDoubleBang/conditionInvalidBinaryExp.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/branched/ifThenToDoubleBang/conditionInvalidBinaryExp.kt
@@ -1,7 +1,7 @@
// WITH_RUNTIME
// IS_APPLICABLE: false
-fun T.compareTo(a: T): Int = 0
+operator fun T.compareTo(a: T): Int = 0
fun main(args: Array) {
val foo = null
diff --git a/plugins/kotlin/idea/tests/testData/intentions/branched/ifThenToElvis/conditionInvalidBinaryExp.kt b/plugins/kotlin/idea/tests/testData/intentions/branched/ifThenToElvis/conditionInvalidBinaryExp.kt
index ffc885e542ef..d4c091bf323c 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/branched/ifThenToElvis/conditionInvalidBinaryExp.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/branched/ifThenToElvis/conditionInvalidBinaryExp.kt
@@ -1,5 +1,5 @@
// IS_APPLICABLE: false
-fun T.compareTo(a: T): Int = 0
+operator fun T.compareTo(a: T): Int = 0
fun main(args: Array) {
val foo = null
diff --git a/plugins/kotlin/idea/tests/testData/intentions/branched/ifThenToSafeAccess/conditionInvalidBinaryExp.kt b/plugins/kotlin/idea/tests/testData/intentions/branched/ifThenToSafeAccess/conditionInvalidBinaryExp.kt
index f6432dc43825..c29ab881c3e7 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/branched/ifThenToSafeAccess/conditionInvalidBinaryExp.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/branched/ifThenToSafeAccess/conditionInvalidBinaryExp.kt
@@ -1,5 +1,5 @@
// IS_APPLICABLE: false
-fun T.compareTo(a: T): Int = 0
+operator fun T.compareTo(a: T): Int = 0
fun main(args: Array) {
val foo = "foo"
diff --git a/plugins/kotlin/idea/tests/testData/intentions/branched/ifThenToSafeAccess/conditionNotBinaryExpr.kt b/plugins/kotlin/idea/tests/testData/intentions/branched/ifThenToSafeAccess/conditionNotBinaryExpr.kt
index 681e65feeee5..23549502ede7 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/branched/ifThenToSafeAccess/conditionNotBinaryExpr.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/branched/ifThenToSafeAccess/conditionNotBinaryExpr.kt
@@ -1,5 +1,5 @@
// IS_APPLICABLE: false
-fun String?.times(a: Int): Boolean = a == 0
+operator fun String?.times(a: Int): Boolean = a == 0
fun main(args: Array) {
val foo: String = "foo"
diff --git a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/complexPlus.kt b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/complexPlus.kt
index 90584de7521b..1773e0aaaf4f 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/complexPlus.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/complexPlus.kt
@@ -1,10 +1,10 @@
-fun doSomething(a: T) {}
+fun 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).unaryPlus())).toString())
diff --git a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/complexPlus.kt.after b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/complexPlus.kt.after
index 175daac30737..39bb9fe77edb 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/complexPlus.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/complexPlus.kt.after
@@ -1,10 +1,10 @@
-fun doSomething(a: T) {}
+fun 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())
diff --git a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/extensionFunction.kt b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/extensionFunction.kt
index 8e47f5e4e556..5f9d50cdd90e 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/extensionFunction.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/extensionFunction.kt
@@ -1,7 +1,7 @@
fun test() {
class Test()
- fun Test.unaryPlus(): Test = Test()
+ operator fun Test.unaryPlus(): Test = Test()
val test = Test()
test.unaryPlus()
diff --git a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/extensionFunction.kt.after b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/extensionFunction.kt.after
index b3efb2dbaf8f..d48f923f20f1 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/extensionFunction.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/extensionFunction.kt.after
@@ -1,7 +1,7 @@
fun test() {
class Test()
- fun Test.unaryPlus(): Test = Test()
+ operator fun Test.unaryPlus(): Test = Test()
val test = Test()
+test
diff --git a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/minusSanityTest.kt b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/minusSanityTest.kt
index b3083f198a12..7cdd5ed5a2dd 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/minusSanityTest.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/minusSanityTest.kt
@@ -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.unaryMinus()
diff --git a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/minusSanityTest.kt.after b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/minusSanityTest.kt.after
index ccc39653c566..9fa986eaa2ba 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/minusSanityTest.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/minusSanityTest.kt.after
@@ -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
diff --git a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/plusPlus.kt b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/plusPlus.kt
index 1b5a568f7268..02d9a9936f6d 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/plusPlus.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/plusPlus.kt
@@ -1,6 +1,6 @@
fun test() {
class Test {
- fun unaryPlus(): Test = Test()
+ operator fun unaryPlus(): Test = Test()
}
val test = Test()
+test.unaryPlus()
diff --git a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/plusPlus.kt.after b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/plusPlus.kt.after
index c4213b3430f9..0267910c3542 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/plusPlus.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/plusPlus.kt.after
@@ -1,6 +1,6 @@
fun test() {
class Test {
- fun unaryPlus(): Test = Test()
+ operator fun unaryPlus(): Test = Test()
}
val test = Test()
+(+test)
diff --git a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/plusSanityTest.kt b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/plusSanityTest.kt
index 3cc07d9d70c2..5a2a5dae3aa4 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/plusSanityTest.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/plusSanityTest.kt
@@ -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.unaryPlus()
diff --git a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/plusSanityTest.kt.after b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/plusSanityTest.kt.after
index 87046c7f5e3e..04355017b187 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/plusSanityTest.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/plusSanityTest.kt.after
@@ -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
diff --git a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/qualifier.kt b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/qualifier.kt
index 49b99081d5be..252f62839744 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/qualifier.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/qualifier.kt
@@ -1,6 +1,6 @@
class C {
companion object {
- fun unaryMinus(): C = C()
+ operator fun unaryMinus(): C = C()
}
}
diff --git a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/qualifier.kt.after b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/qualifier.kt.after
index 63a45078ab66..9ad0a501be9b 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/qualifier.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/qualifier.kt.after
@@ -1,6 +1,6 @@
class C {
companion object {
- fun unaryMinus(): C = C()
+ operator fun unaryMinus(): C = C()
}
}
diff --git a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/super.kt b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/super.kt
index 90f14507191c..2d77154562da 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/super.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/super.kt
@@ -1,7 +1,7 @@
// IS_APPLICABLE: false
open class Base {
- open fun unaryMinus() = this
+ open operator fun unaryMinus() = this
}
class C : Base() {
diff --git a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/typeArguments.kt b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/typeArguments.kt
index bb92785b5131..d33ef248a67c 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/typeArguments.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/typeArguments.kt
@@ -1,7 +1,7 @@
// IS_APPLICABLE: false
fun test() {
class Test {
- fun unaryPlus(): T? = this as? T
+ operator fun unaryPlus(): T? = this as? T
}
val test = Test()
test.unaryPlus()
diff --git a/plugins/kotlin/idea/tests/testData/intentions/convertForEachToForLoop/infixCall.kt b/plugins/kotlin/idea/tests/testData/intentions/convertForEachToForLoop/infixCall.kt
index cfb82e118d3d..34950f29c486 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/convertForEachToForLoop/infixCall.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/convertForEachToForLoop/infixCall.kt
@@ -2,5 +2,5 @@
fun foo() {
val x = 1..4
- x forEach { a -> a }
+ x.forEach { a -> a }
}
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/intentions/convertForEachToForLoop/infixCallNotAvailable.kt b/plugins/kotlin/idea/tests/testData/intentions/convertForEachToForLoop/infixCallNotAvailable.kt
index e4a9a07a8af4..78dd41741f6b 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/convertForEachToForLoop/infixCallNotAvailable.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/convertForEachToForLoop/infixCallNotAvailable.kt
@@ -3,5 +3,5 @@
fun foo() {
val x = 1..4
- x forEach { a -> a }
+ x.forEach { a -> a }
}
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/intentions/convertForEachToForLoop/parenthesizedExpression.kt b/plugins/kotlin/idea/tests/testData/intentions/convertForEachToForLoop/parenthesizedExpression.kt
index 67b40498721b..5241bbc0c74f 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/convertForEachToForLoop/parenthesizedExpression.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/convertForEachToForLoop/parenthesizedExpression.kt
@@ -1,4 +1,7 @@
// WITH_RUNTIME
+
+infix fun Int.upTo(other: Int) = this.rangeTo(other)
+
fun main() {
- (1 rangeTo 2).forEach { x -> x }
+ (1 upTo 2).forEach { x -> x }
}
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/intentions/convertForEachToForLoop/parenthesizedExpression.kt.after b/plugins/kotlin/idea/tests/testData/intentions/convertForEachToForLoop/parenthesizedExpression.kt.after
index 1d0cf3af3408..2f8f17c7e9e0 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/convertForEachToForLoop/parenthesizedExpression.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/convertForEachToForLoop/parenthesizedExpression.kt.after
@@ -1,6 +1,9 @@
// WITH_RUNTIME
+
+infix fun Int.upTo(other: Int) = this.rangeTo(other)
+
fun main() {
- for (x in 1 rangeTo 2) {
+ for (x in 1 upTo 2) {
x
}
}
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/intentions/convertFunctionToProperty/invoke.kt b/plugins/kotlin/idea/tests/testData/intentions/convertFunctionToProperty/invoke.kt
index 7c5cad4f6b8e..85f3c7842c3f 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/convertFunctionToProperty/invoke.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/convertFunctionToProperty/invoke.kt
@@ -1,7 +1,7 @@
// WITH_RUNTIME
// IS_APPLICABLE: false
class A(val n: Int) {
- fun invoke(): Int = 1
+ operator fun invoke(): Int = 1
}
fun test(a: A) {
diff --git a/plugins/kotlin/idea/tests/testData/intentions/convertFunctionToProperty/iterator.kt b/plugins/kotlin/idea/tests/testData/intentions/convertFunctionToProperty/iterator.kt
index e13485954fee..897b340522c8 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/convertFunctionToProperty/iterator.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/convertFunctionToProperty/iterator.kt
@@ -1,7 +1,7 @@
// WITH_RUNTIME
// IS_APPLICABLE: false
class A(val n: Int) {
- fun iterator(): Iterator = throw Exception("")
+ operator fun iterator(): Iterator = throw Exception("")
}
fun test() {
diff --git a/plugins/kotlin/idea/tests/testData/intentions/convertFunctionToProperty/unaryOp.kt b/plugins/kotlin/idea/tests/testData/intentions/convertFunctionToProperty/unaryOp.kt
index b058aaa31cb6..c7bab8c25ac2 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/convertFunctionToProperty/unaryOp.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/convertFunctionToProperty/unaryOp.kt
@@ -1,7 +1,7 @@
// WITH_RUNTIME
// IS_APPLICABLE: false
class A(val n: Int) {
- fun unaryMinus(): A = A(-n)
+ operator fun unaryMinus(): A = A(-n)
}
fun test() {
diff --git a/plugins/kotlin/idea/tests/testData/intentions/convertNegatedExpressionWithDemorgansLaw/doubleNegation.kt b/plugins/kotlin/idea/tests/testData/intentions/convertNegatedExpressionWithDemorgansLaw/doubleNegation.kt
index 51ede2c0e1f4..82e75fd43ba4 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/convertNegatedExpressionWithDemorgansLaw/doubleNegation.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/convertNegatedExpressionWithDemorgansLaw/doubleNegation.kt
@@ -1,4 +1,4 @@
-fun String.not(): Boolean {
+operator fun String.not(): Boolean {
return length == 0
}
diff --git a/plugins/kotlin/idea/tests/testData/intentions/convertNegatedExpressionWithDemorgansLaw/doubleNegation.kt.after b/plugins/kotlin/idea/tests/testData/intentions/convertNegatedExpressionWithDemorgansLaw/doubleNegation.kt.after
index 5a36e3b8012b..f805056486b3 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/convertNegatedExpressionWithDemorgansLaw/doubleNegation.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/convertNegatedExpressionWithDemorgansLaw/doubleNegation.kt.after
@@ -1,4 +1,4 @@
-fun String.not(): Boolean {
+operator fun String.not(): Boolean {
return length == 0
}
diff --git a/plugins/kotlin/idea/tests/testData/intentions/convertNegatedExpressionWithDemorgansLaw/nonstandardPrefixOperator.kt b/plugins/kotlin/idea/tests/testData/intentions/convertNegatedExpressionWithDemorgansLaw/nonstandardPrefixOperator.kt
index 37ba863a6490..a1070c18defb 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/convertNegatedExpressionWithDemorgansLaw/nonstandardPrefixOperator.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/convertNegatedExpressionWithDemorgansLaw/nonstandardPrefixOperator.kt
@@ -1,4 +1,4 @@
-fun Boolean.plus(): Boolean {
+operator fun Boolean.unaryPlus(): Boolean {
return false
}
diff --git a/plugins/kotlin/idea/tests/testData/intentions/convertNegatedExpressionWithDemorgansLaw/nonstandardPrefixOperator.kt.after b/plugins/kotlin/idea/tests/testData/intentions/convertNegatedExpressionWithDemorgansLaw/nonstandardPrefixOperator.kt.after
index dd4562c36ece..0168d30491d7 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/convertNegatedExpressionWithDemorgansLaw/nonstandardPrefixOperator.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/convertNegatedExpressionWithDemorgansLaw/nonstandardPrefixOperator.kt.after
@@ -1,4 +1,4 @@
-fun Boolean.plus(): Boolean {
+operator fun Boolean.unaryPlus(): Boolean {
return false
}
diff --git a/plugins/kotlin/idea/tests/testData/intentions/convertToForEachFunctionCall/binaryExpressionLoopRange.kt b/plugins/kotlin/idea/tests/testData/intentions/convertToForEachFunctionCall/binaryExpressionLoopRange.kt
index fe47f57dbbfb..4714e5510b7b 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/convertToForEachFunctionCall/binaryExpressionLoopRange.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/convertToForEachFunctionCall/binaryExpressionLoopRange.kt
@@ -1,6 +1,6 @@
// WITH_RUNTIME
fun main() {
- for (x in 1 rangeTo 2) {
+ for (x in 1.rangeTo(2)) {
x
}
}
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/intentions/convertToForEachFunctionCall/binaryExpressionLoopRange.kt.after b/plugins/kotlin/idea/tests/testData/intentions/convertToForEachFunctionCall/binaryExpressionLoopRange.kt.after
index a0deecc549ec..c923c8bb2675 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/convertToForEachFunctionCall/binaryExpressionLoopRange.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/convertToForEachFunctionCall/binaryExpressionLoopRange.kt.after
@@ -1,4 +1,4 @@
// WITH_RUNTIME
fun main() {
- (1 rangeTo 2).forEach { x -> x }
+ 1.rangeTo(2).forEach { x -> x }
}
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/functionLiteralArgument.kt b/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/functionLiteralArgument.kt
index 57518537c718..2b3e997c6ac6 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/functionLiteralArgument.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/functionLiteralArgument.kt
@@ -1,5 +1,5 @@
interface Foo {
- fun foo(f: (Int) -> Unit)
+ infix fun foo(f: (Int) -> Unit)
}
fun foo(x: Foo) {
x foo { it * 2 }
diff --git a/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/functionLiteralArgument.kt.after b/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/functionLiteralArgument.kt.after
index 6eefdcc0907c..306dc3a5f4b0 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/functionLiteralArgument.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/functionLiteralArgument.kt.after
@@ -1,5 +1,5 @@
interface Foo {
- fun foo(f: (Int) -> Unit)
+ infix fun foo(f: (Int) -> Unit)
}
fun foo(x: Foo) {
x.foo { it * 2 }
diff --git a/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/nullAssertedCall.kt b/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/nullAssertedCall.kt
index d15aa7aa570e..3fe7d2ca2473 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/nullAssertedCall.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/nullAssertedCall.kt
@@ -1,3 +1,5 @@
+infix fun String.compareTo(other: String) = 0
+
fun foo(x: String) {
x!! compareTo "1"
}
diff --git a/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/nullAssertedCall.kt.after b/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/nullAssertedCall.kt.after
index 7eb0a544afe6..daffee382848 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/nullAssertedCall.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/nullAssertedCall.kt.after
@@ -1,3 +1,5 @@
+infix fun String.compareTo(other: String) = 0
+
fun foo(x: String) {
x!!.compareTo("1")
}
diff --git a/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/parenthesesAroundRightHandArgument.kt b/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/parenthesesAroundRightHandArgument.kt
index 68934da493b2..ad141ed134ff 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/parenthesesAroundRightHandArgument.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/parenthesesAroundRightHandArgument.kt
@@ -1,3 +1,5 @@
+infix fun String.add(other: String) = ""
+
fun foo(x: String) {
- x plus ("1" + "2")
+ x add ("1" + "2")
}
diff --git a/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/parenthesesAroundRightHandArgument.kt.after b/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/parenthesesAroundRightHandArgument.kt.after
index e21575bb82fe..fa3f9940713c 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/parenthesesAroundRightHandArgument.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/parenthesesAroundRightHandArgument.kt.after
@@ -1,3 +1,5 @@
+infix fun String.add(other: String) = ""
+
fun foo(x: String) {
- x.plus("1" + "2")
+ x.add("1" + "2")
}
diff --git a/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/simpleInfixFunctionCall.kt b/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/simpleInfixFunctionCall.kt
index 3905bb0ed64c..7b4116c034ea 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/simpleInfixFunctionCall.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/simpleInfixFunctionCall.kt
@@ -1,3 +1,5 @@
+infix fun Int.compareTo(other: Int) = 0
+
fun foo(x: Int) {
x compareTo 1
}
diff --git a/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/simpleInfixFunctionCall.kt.after b/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/simpleInfixFunctionCall.kt.after
index 3f32bd9e9c42..1da32e561ab0 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/simpleInfixFunctionCall.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/infixCallToOrdinary/simpleInfixFunctionCall.kt.after
@@ -1,3 +1,5 @@
+infix fun Int.compareTo(other: Int) = 0
+
fun foo(x: Int) {
x.compareTo(1)
}
diff --git a/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/arrayAccessMultipleIndex.kt b/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/arrayAccessMultipleIndex.kt
index 88a8ec796177..f1afee6ce7b0 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/arrayAccessMultipleIndex.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/arrayAccessMultipleIndex.kt
@@ -1,5 +1,5 @@
class Bar {
- fun get(vararg args: Int) {}
+ operator fun get(vararg args: Int) {}
}
fun foo(a: Bar, i: Int) {
diff --git a/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/arrayAccessMultipleIndex.kt.after b/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/arrayAccessMultipleIndex.kt.after
index 66376895418b..befabd6654d6 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/arrayAccessMultipleIndex.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/arrayAccessMultipleIndex.kt.after
@@ -1,5 +1,5 @@
class Bar {
- fun get(vararg args: Int) {}
+ operator fun get(vararg args: Int) {}
}
fun foo(a: Bar, i: Int) {
diff --git a/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/binaryPlusEquals.kt b/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/binaryPlusEquals.kt
index 6b4fd1a30e97..51968cfa3334 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/binaryPlusEquals.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/binaryPlusEquals.kt
@@ -1,5 +1,5 @@
class Bar {
- fun plusAssign(arg: Bar) {}
+ operator fun plusAssign(arg: Bar) {}
}
fun foo(b: Bar) {
diff --git a/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/binaryPlusEquals.kt.after b/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/binaryPlusEquals.kt.after
index e20ec04548fe..25818100c1a9 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/binaryPlusEquals.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/binaryPlusEquals.kt.after
@@ -1,5 +1,5 @@
class Bar {
- fun plusAssign(arg: Bar) {}
+ operator fun plusAssign(arg: Bar) {}
}
fun foo(b: Bar) {
diff --git a/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallMultipleArgument.kt b/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallMultipleArgument.kt
index 92710592dde3..32d87d8ac745 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallMultipleArgument.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallMultipleArgument.kt
@@ -1,5 +1,5 @@
class bar() {
- fun invoke(i: Any?, j: Any?) : Boolean {
+ operator fun invoke(i: Any?, j: Any?) : Boolean {
return true
}
}
diff --git a/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallMultipleArgument.kt.after b/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallMultipleArgument.kt.after
index 2b8528e8fd43..877b2b41913b 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallMultipleArgument.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallMultipleArgument.kt.after
@@ -1,5 +1,5 @@
class bar() {
- fun invoke(i: Any?, j: Any?) : Boolean {
+ operator fun invoke(i: Any?, j: Any?) : Boolean {
return true
}
}
diff --git a/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallWithMultipleArgumentsAndSingleLambda.kt b/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallWithMultipleArgumentsAndSingleLambda.kt
index 7874980140d4..6449c4e83f0b 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallWithMultipleArgumentsAndSingleLambda.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallWithMultipleArgumentsAndSingleLambda.kt
@@ -1,5 +1,5 @@
class Mocha() {
- fun invoke(x: Int, y: String, f: (Int) -> String) {
+ operator fun invoke(x: Int, y: String, f: (Int) -> String) {
}
}
fun main() {
diff --git a/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallWithMultipleArgumentsAndSingleLambda.kt.after b/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallWithMultipleArgumentsAndSingleLambda.kt.after
index f0b80c3eda71..d5496b8894d6 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallWithMultipleArgumentsAndSingleLambda.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallWithMultipleArgumentsAndSingleLambda.kt.after
@@ -1,5 +1,5 @@
class Mocha() {
- fun invoke(x: Int, y: String, f: (Int) -> String) {
+ operator fun invoke(x: Int, y: String, f: (Int) -> String) {
}
}
fun main() {
diff --git a/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallWithSingleLambda.kt b/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallWithSingleLambda.kt
index 89b97d719c4b..453df8edf604 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallWithSingleLambda.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallWithSingleLambda.kt
@@ -1,5 +1,5 @@
class Mocha() {
- fun invoke(f: (Int) -> String) {}
+ operator fun invoke(f: (Int) -> String) {}
}
fun main() {
val mocha = Mocha()
diff --git a/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallWithSingleLambda.kt.after b/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallWithSingleLambda.kt.after
index 89760fa36d87..3bbe35d4bfde 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallWithSingleLambda.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/operatorToFunction/functionCallWithSingleLambda.kt.after
@@ -1,5 +1,5 @@
class Mocha() {
- fun invoke(f: (Int) -> String) {}
+ operator fun invoke(f: (Int) -> String) {}
}
fun main() {
val mocha = Mocha()
diff --git a/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/necessaryParentheses5.kt b/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/necessaryParentheses5.kt
index 494b05895cac..0c2fa9578549 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/necessaryParentheses5.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/necessaryParentheses5.kt
@@ -1,7 +1,7 @@
// IS_APPLICABLE: false
interface Foo {
- fun get(x : Any) : Foo
- fun plus(x : Any) : Foo
+ operator fun get(x : Any) : Foo
+ operator fun plus(x : Any) : Foo
}
fun foo(x: Foo) {
(x + x)[x]
diff --git a/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses3.kt b/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses3.kt
index b96a13384822..1fcaff95c4a2 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses3.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses3.kt
@@ -1,5 +1,5 @@
interface Foo {
- fun get(x : Any) : Foo
+ operator fun get(x : Any) : Foo
}
fun foo(x: Foo) {
(x[x])[x]
diff --git a/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses3.kt.after b/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses3.kt.after
index 50b541447d3b..61f5e1457db0 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses3.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses3.kt.after
@@ -1,5 +1,5 @@
interface Foo {
- fun get(x : Any) : Foo
+ operator fun get(x : Any) : Foo
}
fun foo(x: Foo) {
x[x][x]
diff --git a/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses4.kt b/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses4.kt
index afd088c2ec46..ac7f1b0e32c4 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses4.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses4.kt
@@ -1,6 +1,6 @@
interface Foo {
- fun inc() : Foo
- fun not() : Foo
+ operator fun inc() : Foo
+ operator fun not() : Foo
}
fun foo(x: Foo) {
!(x.inc())
diff --git a/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses4.kt.after b/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses4.kt.after
index f4f0d4cc866f..c813dbd069c4 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses4.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses4.kt.after
@@ -1,6 +1,6 @@
interface Foo {
- fun inc() : Foo
- fun not() : Foo
+ operator fun inc() : Foo
+ operator fun not() : Foo
}
fun foo(x: Foo) {
!x.inc()
diff --git a/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses8.kt b/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses8.kt
index 9a57e7ef813d..7ffaf9306491 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses8.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses8.kt
@@ -1,5 +1,5 @@
class C() {
- fun get(i: Int) = i + 1
+ operator fun get(i: Int) = i + 1
// KT-4513: Unnecessary parenthesis around 'this'
val foo = (this)[41]
diff --git a/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses8.kt.after b/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses8.kt.after
index 2b597c6f0f3b..47ed99246c37 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses8.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses8.kt.after
@@ -1,5 +1,5 @@
class C() {
- fun get(i: Int) = i + 1
+ operator fun get(i: Int) = i + 1
// KT-4513: Unnecessary parenthesis around 'this'
val foo = this[41]
diff --git a/plugins/kotlin/idea/tests/testData/intentions/simplifyNegatedBinaryExpression/in.kt b/plugins/kotlin/idea/tests/testData/intentions/simplifyNegatedBinaryExpression/in.kt
index bd9c8ea4e950..ab89ede2a84e 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/simplifyNegatedBinaryExpression/in.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/simplifyNegatedBinaryExpression/in.kt
@@ -1,6 +1,6 @@
// INTENTION_TEXT: Simplify negated 'in' expression to '!in'
class A(val e: Int) {
- fun contains(i: Int): Boolean = e == i
+ operator fun contains(i: Int): Boolean = e == i
}
fun test(n: Int) {
diff --git a/plugins/kotlin/idea/tests/testData/intentions/simplifyNegatedBinaryExpression/in.kt.after b/plugins/kotlin/idea/tests/testData/intentions/simplifyNegatedBinaryExpression/in.kt.after
index 0416942d8cc5..4ec59f269662 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/simplifyNegatedBinaryExpression/in.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/simplifyNegatedBinaryExpression/in.kt.after
@@ -1,6 +1,6 @@
// INTENTION_TEXT: Simplify negated 'in' expression to '!in'
class A(val e: Int) {
- fun contains(i: Int): Boolean = e == i
+ operator fun contains(i: Int): Boolean = e == i
}
fun test(n: Int) {
diff --git a/plugins/kotlin/idea/tests/testData/intentions/simplifyNegatedBinaryExpression/inapplicableBinaryOperation.kt b/plugins/kotlin/idea/tests/testData/intentions/simplifyNegatedBinaryExpression/inapplicableBinaryOperation.kt
index 6ea57272a841..e59e1b4e6212 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/simplifyNegatedBinaryExpression/inapplicableBinaryOperation.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/simplifyNegatedBinaryExpression/inapplicableBinaryOperation.kt
@@ -1,5 +1,5 @@
// IS_APPLICABLE: false
-fun Int.lt(b: Int): Boolean = this < b
+infix fun Int.lt(b: Int): Boolean = this < b
fun test(n: Int) {
!(1 lt 2)
}
diff --git a/plugins/kotlin/idea/tests/testData/intentions/simplifyNegatedBinaryExpression/notIn.kt b/plugins/kotlin/idea/tests/testData/intentions/simplifyNegatedBinaryExpression/notIn.kt
index f046f9871197..44a913ccfa5c 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/simplifyNegatedBinaryExpression/notIn.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/simplifyNegatedBinaryExpression/notIn.kt
@@ -1,6 +1,6 @@
// INTENTION_TEXT: Simplify negated '!in' expression to 'in'
class A(val e: Int) {
- fun contains(i: Int): Boolean = e == i
+ operator fun contains(i: Int): Boolean = e == i
}
fun test(n: Int) {
diff --git a/plugins/kotlin/idea/tests/testData/intentions/simplifyNegatedBinaryExpression/notIn.kt.after b/plugins/kotlin/idea/tests/testData/intentions/simplifyNegatedBinaryExpression/notIn.kt.after
index 601418786216..f6867ae2852e 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/simplifyNegatedBinaryExpression/notIn.kt.after
+++ b/plugins/kotlin/idea/tests/testData/intentions/simplifyNegatedBinaryExpression/notIn.kt.after
@@ -1,6 +1,6 @@
// INTENTION_TEXT: Simplify negated '!in' expression to 'in'
class A(val e: Int) {
- fun contains(i: Int): Boolean = e == i
+ operator fun contains(i: Int): Boolean = e == i
}
fun test(n: Int) {
diff --git a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/compareTo.kt b/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/compareTo.kt
deleted file mode 100644
index 931f70c49d47..000000000000
--- a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/compareTo.kt
+++ /dev/null
@@ -1,4 +0,0 @@
-// IS_APPLICABLE: false
-fun main() {
- val testing = 5 compareTo 10
-}
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/divideLiteral.kt b/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/divideLiteral.kt
deleted file mode 100644
index d640b4c2f57a..000000000000
--- a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/divideLiteral.kt
+++ /dev/null
@@ -1,4 +0,0 @@
-// IS_APPLICABLE: false
-fun main() {
- val test = 5 div 2
-}
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/equalsLiteral.kt b/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/equalsLiteral.kt
deleted file mode 100644
index 930623054b60..000000000000
--- a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/equalsLiteral.kt
+++ /dev/null
@@ -1,3 +0,0 @@
-fun neq(a: Int, b: Int) {
- if (a equals b) {}
-}
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/equalsLiteral.kt.after b/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/equalsLiteral.kt.after
deleted file mode 100644
index 2407d8ec4ed9..000000000000
--- a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/equalsLiteral.kt.after
+++ /dev/null
@@ -1,3 +0,0 @@
-fun neq(a: Int, b: Int) {
- if (b equals a) {}
-}
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/identityEqualsLiteral.kt b/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/identityEqualsLiteral.kt
deleted file mode 100644
index 8998a30a32d7..000000000000
--- a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/identityEqualsLiteral.kt
+++ /dev/null
@@ -1,3 +0,0 @@
-fun neq(a: Int, b: Int) {
- if (a identityEquals b) {}
-}
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/identityEqualsLiteral.kt.after b/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/identityEqualsLiteral.kt.after
deleted file mode 100644
index ca6f4f0ab462..000000000000
--- a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/identityEqualsLiteral.kt.after
+++ /dev/null
@@ -1,3 +0,0 @@
-fun neq(a: Int, b: Int) {
- if (b identityEquals a) {}
-}
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/infixFunction.kt b/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/infixFunction.kt
index 67fef9d2456e..738672ac1cd7 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/infixFunction.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/infixFunction.kt
@@ -1,6 +1,6 @@
// IS_APPLICABLE: false
class Foo() {
- fun cat(x: Int): Int {return x}
+ infix fun cat(x: Int): Int {return x}
}
fun main() {
diff --git a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/minusLiteral.kt b/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/minusLiteral.kt
deleted file mode 100644
index 7dd7beb055e8..000000000000
--- a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/minusLiteral.kt
+++ /dev/null
@@ -1,4 +0,0 @@
-// IS_APPLICABLE: false
-fun new(x: Int, y: Int): Int {
- return y minus x
-}
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/plusLiteral.kt b/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/plusLiteral.kt
deleted file mode 100644
index db5fbae1ba32..000000000000
--- a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/plusLiteral.kt
+++ /dev/null
@@ -1,3 +0,0 @@
-fun test(a: Int, b: Int): Int {
- return a plus b
-}
diff --git a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/plusLiteral.kt.after b/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/plusLiteral.kt.after
deleted file mode 100644
index bcd1af9c7cae..000000000000
--- a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/plusLiteral.kt.after
+++ /dev/null
@@ -1,3 +0,0 @@
-fun test(a: Int, b: Int): Int {
- return b plus a
-}
diff --git a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/rangeTo.kt b/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/rangeTo.kt
index 93713174fb82..912028c13e23 100644
--- a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/rangeTo.kt
+++ b/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/rangeTo.kt
@@ -1,5 +1,5 @@
// IS_APPLICABLE: false
-fun doSomething(a: T) {}
+fun doSomething(a: T) {}
fun main() {
for (i in 1..10) {
diff --git a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/rangeToLiteral.kt b/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/rangeToLiteral.kt
deleted file mode 100644
index acd4506490a1..000000000000
--- a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/rangeToLiteral.kt
+++ /dev/null
@@ -1,8 +0,0 @@
-// IS_APPLICABLE: false
-fun doSomething(a: T) {}
-
-fun main() {
- for (i in 1 rangeTo 10) {
- doSomething("Hello World")
- }
-}
diff --git a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/timesLiteral.kt b/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/timesLiteral.kt
deleted file mode 100644
index 02c2a61d0536..000000000000
--- a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/timesLiteral.kt
+++ /dev/null
@@ -1,3 +0,0 @@
-fun test(a: Int, b: Int): Int {
- return a times b
-}
diff --git a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/timesLiteral.kt.after b/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/timesLiteral.kt.after
deleted file mode 100644
index 90346fd81929..000000000000
--- a/plugins/kotlin/idea/tests/testData/intentions/swapBinaryExpression/timesLiteral.kt.after
+++ /dev/null
@@ -1,3 +0,0 @@
-fun test(a: Int, b: Int): Int {
- return b times a
-}
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/autoImports/delegateExtensionSet.test b/plugins/kotlin/idea/tests/testData/quickfix/autoImports/delegateExtensionSet.test
index 6eab383a7c00..cc3cb1e2c6aa 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/autoImports/delegateExtensionSet.test
+++ b/plugins/kotlin/idea/tests/testData/quickfix/autoImports/delegateExtensionSet.test
@@ -19,8 +19,8 @@ class DelegateImpl {
val value: T = null!!
}
-public fun DelegateImpl.getValue(thisRef: Any?, property: PropertyMetadata): T = value
-public fun DelegateImpl.setValue(thisRef: Any, propertyMetadata: PropertyMetadata, t: T) {}
+operator fun DelegateImpl.getValue(thisRef: Any?, property: PropertyMetadata): T = value
+operator fun DelegateImpl.setValue(thisRef: Any, propertyMetadata: PropertyMetadata, t: T) {}
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/autoImports/indexCallExtensionImportGetOnNoOperatorWarning.test b/plugins/kotlin/idea/tests/testData/quickfix/autoImports/indexCallExtensionImportGetOnNoOperatorWarning.test
index ea7bcc0aa4de..3b640bd10224 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/autoImports/indexCallExtensionImportGetOnNoOperatorWarning.test
+++ b/plugins/kotlin/idea/tests/testData/quickfix/autoImports/indexCallExtensionImportGetOnNoOperatorWarning.test
@@ -1,5 +1,6 @@
// FILE: first.before.kt
// "Import" "true"
+// ERROR: operator modifier is required on 'get' in 'some.Some'
package testing
@@ -26,6 +27,7 @@ operator fun Some.get(s: String) {}
// FILE: first.after.kt
// "Import" "true"
+// ERROR: operator modifier is required on 'get' in 'some.Some'
package testing
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/autoImports/indexCallExtensionImportSetOnNoOperatorWarning.test b/plugins/kotlin/idea/tests/testData/quickfix/autoImports/indexCallExtensionImportSetOnNoOperatorWarning.test
index 2a69f346342c..51a3f47e6f58 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/autoImports/indexCallExtensionImportSetOnNoOperatorWarning.test
+++ b/plugins/kotlin/idea/tests/testData/quickfix/autoImports/indexCallExtensionImportSetOnNoOperatorWarning.test
@@ -1,5 +1,6 @@
// FILE: first.before.kt
// "Import" "true"
+// ERROR: operator modifier is required on 'set' in 'some.Some'
package testing
@@ -26,6 +27,7 @@ operator fun Some.set(s: String, i: Int) {}
// FILE: first.after.kt
// "Import" "true"
+// ERROR: operator modifier is required on 'set' in 'some.Some'
package testing
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/checkArguments/addNameToArgument/invokeOnString.kt b/plugins/kotlin/idea/tests/testData/quickfix/checkArguments/addNameToArgument/invokeOnString.kt
index 73b6d2c21aae..180f69956cfe 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/checkArguments/addNameToArgument/invokeOnString.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/checkArguments/addNameToArgument/invokeOnString.kt
@@ -1,5 +1,5 @@
// "Add name to argument: 'b = 42'" "true"
-fun String.invoke(a: Int, b: Int) {}
+operator fun String.invoke(a: Int, b: Int) {}
fun g() {
""(a = 1, 42)
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/checkArguments/addNameToArgument/invokeOnString.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/checkArguments/addNameToArgument/invokeOnString.kt.after
index 13522e679479..7a1c8a6e2773 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/checkArguments/addNameToArgument/invokeOnString.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/checkArguments/addNameToArgument/invokeOnString.kt.after
@@ -1,5 +1,5 @@
// "Add name to argument: 'b = 42'" "true"
-fun String.invoke(a: Int, b: Int) {}
+operator fun String.invoke(a: Int, b: Int) {}
fun g() {
""(a = 1, b = 42)
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/binaryOperations/customOperationOnUserType.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/binaryOperations/customOperationOnUserType.kt
index ff542e35aa4c..12fd7bd90086 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/binaryOperations/customOperationOnUserType.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/binaryOperations/customOperationOnUserType.kt
@@ -1,4 +1,5 @@
// "Create member function 'foo'" "true"
+// ERROR: infix modifier is required on 'foo' in 'A'
class A(val n: T)
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/binaryOperations/customOperationOnUserType.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/binaryOperations/customOperationOnUserType.kt.after
index dc372ba65737..9cd7bee301d3 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/binaryOperations/customOperationOnUserType.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/binaryOperations/customOperationOnUserType.kt.after
@@ -1,4 +1,5 @@
// "Create member function 'foo'" "true"
+// ERROR: infix modifier is required on 'foo' in 'A'
class A(val n: T) {
infix fun foo(t: T): A {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/binaryOperations/quotedName.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/binaryOperations/quotedName.kt
index 344eb33e65b8..ba958385eba8 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/binaryOperations/quotedName.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/binaryOperations/quotedName.kt
@@ -1,4 +1,6 @@
// "Create extension function '!u00A0'" "true"
+// ERROR: infix modifier is required on '!u00A0' in ''
+
fun test() {
val t: Int = 1 `!u00A0` 2
}
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/binaryOperations/quotedName.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/binaryOperations/quotedName.kt.after
index 21b797677893..dca3908bc1dc 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/binaryOperations/quotedName.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/binaryOperations/quotedName.kt.after
@@ -1,4 +1,6 @@
// "Create extension function '!u00A0'" "true"
+// ERROR: infix modifier is required on '!u00A0' in ''
+
fun test() {
val t: Int = 1 `!u00A0` 2
}
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage1.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage1.kt
index 67da74bd0914..0dffde81f0ed 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage1.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage1.kt
@@ -1,7 +1,7 @@
// "Create member function 'component3'" "true"
class Foo {
- fun component1(): Int { return 0 }
- fun component2(): Int { return 0 }
+ operator fun component1(): Int { return 0 }
+ operator fun component2(): Int { return 0 }
}
fun foo() {
val (a, b, c) = Foo()
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage1.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage1.kt.after
index 64ec1b49dc6d..7f2bea156097 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage1.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage1.kt.after
@@ -1,7 +1,7 @@
// "Create member function 'component3'" "true"
class Foo {
- fun component1(): Int { return 0 }
- fun component2(): Int { return 0 }
+ operator fun component1(): Int { return 0 }
+ operator fun component2(): Int { return 0 }
operator fun component3(): Any {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage2.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage2.kt
index 3c5547cde90d..3fe003d3c27d 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage2.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage2.kt
@@ -1,7 +1,7 @@
// "Create member function 'component3'" "true"
class Foo {
- fun component1(): Int { return 0 }
- fun component2(): Int { return 0 }
+ operator fun component1(): Int { return 0 }
+ operator fun component2(): Int { return 0 }
}
fun foo() {
val (a, b, c: String) = Foo()
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage2.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage2.kt.after
index 936d15b4238c..de8ae858edda 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage2.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage2.kt.after
@@ -1,7 +1,7 @@
// "Create member function 'component3'" "true"
class Foo {
- fun component1(): Int { return 0 }
- fun component2(): Int { return 0 }
+ operator fun component1(): Int { return 0 }
+ operator fun component2(): Int { return 0 }
operator fun component3(): String {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage3.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage3.kt
index eb5917cf1d46..c31b754a2e75 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage3.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage3.kt
@@ -1,16 +1,16 @@
// "Create extension function 'component2'" "true"
class FooIterator {
- fun hasNext(): Boolean { return false }
- fun next(): Any {
+ operator fun hasNext(): Boolean { return false }
+ operator fun next(): Any {
throw UnsupportedOperationException("not implemented")
}
}
class Foo {
- fun iterator(): FooIterator {
+ operator fun iterator(): FooIterator {
throw UnsupportedOperationException("not implemented")
}
}
-fun Any.component1(): Int {
+operator fun Any.component1(): Int {
return 0
}
fun foo() {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage3.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage3.kt.after
index f4fbe37ee2ed..21ae481f8d04 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage3.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/component/createComponentFromUsage3.kt.after
@@ -1,16 +1,16 @@
// "Create extension function 'component2'" "true"
class FooIterator {
- fun hasNext(): Boolean { return false }
- fun next(): Any {
+ operator fun hasNext(): Boolean { return false }
+ operator fun next(): Any {
throw UnsupportedOperationException("not implemented")
}
}
class Foo {
- fun iterator(): FooIterator {
+ operator fun iterator(): FooIterator {
throw UnsupportedOperationException("not implemented")
}
}
-fun Any.component1(): Int {
+operator fun Any.component1(): Int {
return 0
}
fun foo() {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingGet.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingGet.kt
index 3688d4714d62..0069f811b551 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingGet.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingGet.kt
@@ -2,7 +2,7 @@
import kotlin.reflect.KProperty
class F {
- fun setValue(x: X, property: KProperty<*>, i: Int) { }
+ operator fun setValue(x: X, property: KProperty<*>, i: Int) { }
}
class X {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingGet.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingGet.kt.after
index cd6898aa8303..7bfccf79cd42 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingGet.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingGet.kt.after
@@ -2,7 +2,7 @@
import kotlin.reflect.KProperty
class F {
- fun setValue(x: X, property: KProperty<*>, i: Int) { }
+ operator fun setValue(x: X, property: KProperty<*>, i: Int) { }
operator fun getValue(x: X, property: KProperty<*>): Int {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingSet.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingSet.kt
index c7cb7ac972ca..60e3a0179c97 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingSet.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingSet.kt
@@ -2,7 +2,7 @@
import kotlin.reflect.KProperty
class F {
- fun getValue(x: X, property: KProperty<*>): Int = 1
+ operator fun getValue(x: X, property: KProperty<*>): Int = 1
}
class X {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingSet.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingSet.kt.after
index a6f7666592a8..fb23af9afad7 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingSet.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingSet.kt.after
@@ -2,7 +2,7 @@
import kotlin.reflect.KProperty
class F {
- fun getValue(x: X, property: KProperty<*>): Int = 1
+ operator fun getValue(x: X, property: KProperty<*>): Int = 1
operator fun setValue(x: X, property: KProperty<*>, i: Int) {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage1.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage1.kt
index 3619ff1745c6..983c40f13df7 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage1.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage1.kt
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in 'Foo'
+
class Foo {
fun x (y: Foo>) {
val z: Iterable = y[""]
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage1.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage1.kt.after
index 4ed55c29a22c..3f8f3923370b 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage1.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage1.kt.after
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in 'Foo'
+
class Foo {
fun x (y: Foo>) {
val z: Iterable = y[""]
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage10.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage10.kt
index d839d088ac0a..118181a6c0dc 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage10.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage10.kt
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in 'Foo'
+
class Foo {
fun x (y: Foo>, w: java.util.ArrayList) {
val z: Iterable = y["", w]
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage10.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage10.kt.after
index 4fd4f3b54231..6a111575a7df 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage10.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage10.kt.after
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in 'Foo'
+
class Foo {
fun x (y: Foo>, w: java.util.ArrayList) {
val z: Iterable = y["", w]
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage11.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage11.kt
index abe94a8db0fd..ab2de907abd9 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage11.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage11.kt
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in 'Foo'
+
class Foo
fun x (y: Foo>, w: java.util.ArrayList) {
val z: Iterable = y["", w]
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage11.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage11.kt.after
index 26103fbdac7a..0e8fed35debd 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage11.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage11.kt.after
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in 'Foo'
+
class Foo {
operator fun get(s: String, w: T): T {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage12.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage12.kt
index a63474e4cb07..6485b8f13fb2 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage12.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage12.kt
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in 'Foo'
+
class Foo
fun x (y: Foo>, w: java.util.ArrayList) {
val z = y["", w]
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage12.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage12.kt.after
index f8ebf5638e8c..065a3daaabdc 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage12.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage12.kt.after
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in 'Foo'
+
class Foo {
operator fun get(s: String, w: T): Any {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage13.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage13.kt
index e86b7e7e17d2..dec607604d96 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage13.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage13.kt
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in 'Foo'
+
import java.util.ArrayList
class Foo {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage13.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage13.kt.after
index 31dc448b12ff..17468ecfa0d6 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage13.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage13.kt.after
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in 'Foo'
+
import java.util.ArrayList
class Foo {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage2.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage2.kt
index b3722990f1a8..d3a0db8e66e5 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage2.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage2.kt
@@ -1,4 +1,6 @@
// "Create extension function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in ''
+
fun x (y: Any) {
val z: Any = y[""]
}
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage2.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage2.kt.after
index ae5baccb1b39..9484e3367d66 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage2.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage2.kt.after
@@ -1,4 +1,6 @@
// "Create extension function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in ''
+
fun x (y: Any) {
val z: Any = y[""]
}
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage3.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage3.kt
index 71ec52209362..bb751079d2b2 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage3.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage3.kt
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in 'Foo'
+
class Foo {
fun x (y: Foo>) {
val z: Iterable = y[""]
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage3.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage3.kt.after
index c2fbd56ad631..e70e5680cc19 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage3.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage3.kt.after
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in 'Foo'
+
class Foo {
fun x (y: Foo>) {
val z: Iterable = y[""]
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage4.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage4.kt
index ab908843b567..085152fc4c72 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage4.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage4.kt
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in 'Foo'
+
class Foo> {
fun x (y: Foo>) {
val z: U = y[""]
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage4.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage4.kt.after
index ad68666126e7..0e1af892a3c0 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage4.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage4.kt.after
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in 'Foo'
+
class Foo> {
fun x (y: Foo>) {
val z: U = y[""]
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage5.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage5.kt
index 89997fde8c18..478fc12c8d5a 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage5.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage5.kt
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in 'Foo'
+
class Foo {
fun x (y: Foo>, w: Iterable) {
val z: Iterable = y["", w]
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage5.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage5.kt.after
index 7446233adbf0..abd9e447f150 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage5.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage5.kt.after
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in 'Foo'
+
class Foo {
fun x (y: Foo>, w: Iterable) {
val z: Iterable = y["", w]
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage7.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage7.kt
index 218a622ea8d8..7be0b90fb866 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage7.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage7.kt
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in 'Foo'
+
import java.util.ArrayList
class Foo {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage7.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage7.kt.after
index d1e45e2eee08..a8c18fac9819 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage7.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage7.kt.after
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in 'Foo'
+
import java.util.ArrayList
class Foo {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage8.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage8.kt
index a6451c06d085..ad3b163e09ee 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage8.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage8.kt
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in 'Foo'
+
import java.util.ArrayList
class Foo {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage8.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage8.kt.after
index 89a38b760a1e..a427fc0bd721 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage8.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage8.kt.after
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in 'Foo'
+
import java.util.ArrayList
class Foo {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage9.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage9.kt
index 8f0c65e1bdbe..f3f008d3d879 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage9.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage9.kt
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in 'Foo'
+
import java.util.ArrayList
class Foo {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage9.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage9.kt.after
index afd5035a6af8..7721c576544a 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage9.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/get/createGetFromUsage9.kt.after
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
+// ERROR: operator modifier is required on 'get' in 'Foo'
+
import java.util.ArrayList
class Foo {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/hasNext/createHasNextFromUsage1.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/hasNext/createHasNextFromUsage1.kt
index af54c8eebc23..c346a2ff1b55 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/hasNext/createHasNextFromUsage1.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/hasNext/createHasNextFromUsage1.kt
@@ -1,11 +1,11 @@
// "Create member function 'hasNext'" "true"
class FooIterator {
- fun next(): Int {
+ operator fun next(): Int {
throw Exception("not implemented")
}
}
class Foo {
- fun iterator(): FooIterator {
+ operator fun iterator(): FooIterator {
throw Exception("not implemented")
}
}
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/hasNext/createHasNextFromUsage1.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/hasNext/createHasNextFromUsage1.kt.after
index ffcede7997fe..558a379be211 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/hasNext/createHasNextFromUsage1.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/hasNext/createHasNextFromUsage1.kt.after
@@ -1,6 +1,6 @@
// "Create member function 'hasNext'" "true"
class FooIterator {
- fun next(): Int {
+ operator fun next(): Int {
throw Exception("not implemented")
}
@@ -9,7 +9,7 @@ class FooIterator {
}
}
class Foo {
- fun iterator(): FooIterator {
+ operator fun iterator(): FooIterator {
throw Exception("not implemented")
}
}
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/hasNext/createHasNextFromUsage2.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/hasNext/createHasNextFromUsage2.kt
index 990644a02694..18473c230468 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/hasNext/createHasNextFromUsage2.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/hasNext/createHasNextFromUsage2.kt
@@ -1,11 +1,11 @@
// "Create member function 'hasNext'" "true"
class FooIterator {
- fun next(): T {
+ operator fun next(): T {
throw Exception("not implemented")
}
}
class Foo {
- fun iterator(): FooIterator {
+ operator fun iterator(): FooIterator {
throw Exception("not implemented")
}
}
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/hasNext/createHasNextFromUsage2.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/hasNext/createHasNextFromUsage2.kt.after
index 553ed85848cb..7afe5dd82490 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/hasNext/createHasNextFromUsage2.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/hasNext/createHasNextFromUsage2.kt.after
@@ -1,6 +1,6 @@
// "Create member function 'hasNext'" "true"
class FooIterator {
- fun next(): T {
+ operator fun next(): T {
throw Exception("not implemented")
}
@@ -9,7 +9,7 @@ class FooIterator {
}
}
class Foo {
- fun iterator(): FooIterator {
+ operator fun iterator(): FooIterator {
throw Exception("not implemented")
}
}
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/iterator/createIteratorFromUsage3.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/iterator/createIteratorFromUsage3.kt
index 8c1bc5bb117d..1b2c310d9d29 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/iterator/createIteratorFromUsage3.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/iterator/createIteratorFromUsage3.kt
@@ -1,16 +1,16 @@
// "Create member function 'next'" "true"
class FooIterator {
- fun hasNext(): Boolean { return false }
+ operator fun hasNext(): Boolean { return false }
}
class Foo {
- fun iterator(): FooIterator {
+ operator fun iterator(): FooIterator {
throw UnsupportedOperationException("not implemented")
}
}
-fun Any.component1(): Int {
+operator fun Any.component1(): Int {
return 0
}
-fun Any.component2(): Int {
+operator fun Any.component2(): Int {
return 0
}
fun foo() {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/iterator/createIteratorFromUsage3.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/iterator/createIteratorFromUsage3.kt.after
index 10a731e7cbcf..467be063edbf 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/iterator/createIteratorFromUsage3.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/iterator/createIteratorFromUsage3.kt.after
@@ -1,20 +1,20 @@
// "Create member function 'next'" "true"
class FooIterator {
- fun hasNext(): Boolean { return false }
+ operator fun hasNext(): Boolean { return false }
operator fun next(): Any {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
class Foo {
- fun iterator(): FooIterator {
+ operator fun iterator(): FooIterator {
throw UnsupportedOperationException("not implemented")
}
}
-fun Any.component1(): Int {
+operator fun Any.component1(): Int {
return 0
}
-fun Any.component2(): Int {
+operator fun Any.component2(): Int {
return 0
}
fun foo() {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/next/createNextFromUsage1.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/next/createNextFromUsage1.kt
index b1f8035b2b4e..aba536225140 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/next/createNextFromUsage1.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/next/createNextFromUsage1.kt
@@ -1,9 +1,9 @@
// "Create member function 'next'" "true"
class FooIterator {
- fun hasNext(): Boolean { return false }
+ operator fun hasNext(): Boolean { return false }
}
class Foo {
- fun iterator(): FooIterator {
+ operator fun iterator(): FooIterator {
throw Exception("not implemented")
}
}
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/next/createNextFromUsage1.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/next/createNextFromUsage1.kt.after
index 81b0b4c92944..db247c274560 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/next/createNextFromUsage1.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/next/createNextFromUsage1.kt.after
@@ -1,13 +1,13 @@
// "Create member function 'next'" "true"
class FooIterator {
- fun hasNext(): Boolean { return false }
+ operator fun hasNext(): Boolean { return false }
operator fun next(): Int {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
class Foo {
- fun iterator(): FooIterator {
+ operator fun iterator(): FooIterator {
throw Exception("not implemented")
}
}
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/next/createNextFromUsage2.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/next/createNextFromUsage2.kt
index 34f740acb56b..67794a26d1aa 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/next/createNextFromUsage2.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/next/createNextFromUsage2.kt
@@ -1,9 +1,9 @@
// "Create member function 'next'" "true"
class FooIterator {
- fun hasNext(): Boolean { return false }
+ operator fun hasNext(): Boolean { return false }
}
class Foo {
- fun iterator(): FooIterator {
+ operator fun iterator(): FooIterator {
throw Exception("not implemented")
}
}
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/next/createNextFromUsage2.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/next/createNextFromUsage2.kt.after
index bb369dce559f..38cdae353ccb 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/next/createNextFromUsage2.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/next/createNextFromUsage2.kt.after
@@ -1,13 +1,13 @@
// "Create member function 'next'" "true"
class FooIterator {
- fun hasNext(): Boolean { return false }
+ operator fun hasNext(): Boolean { return false }
operator fun next(): T {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
class Foo {
- fun iterator(): FooIterator {
+ operator fun iterator(): FooIterator {
throw Exception("not implemented")
}
}
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/createSetFromUsage1.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/createSetFromUsage1.kt
index be677ce850bd..2ce48512d690 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/createSetFromUsage1.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/createSetFromUsage1.kt
@@ -1,4 +1,6 @@
// "Create member function 'set'" "true"
+// ERROR: operator modifier is required on 'set' in 'Foo'
+
class Foo {
fun x (y: Foo>, w: java.util.ArrayList) {
y["", w] = w
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/createSetFromUsage1.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/createSetFromUsage1.kt.after
index 355f1e154b1f..528ba2c3fac4 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/createSetFromUsage1.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/createSetFromUsage1.kt.after
@@ -1,4 +1,6 @@
// "Create member function 'set'" "true"
+// ERROR: operator modifier is required on 'set' in 'Foo'
+
class Foo {
fun x (y: Foo>, w: java.util.ArrayList) {
y["", w] = w
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/createSetFromUsage2.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/createSetFromUsage2.kt
index 5cfb1848508b..672d7f842b3f 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/createSetFromUsage2.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/createSetFromUsage2.kt
@@ -1,4 +1,5 @@
// "Create extension function 'set'" "true"
+// ERROR: operator modifier is required on 'set' in ''
class Foo {
fun x (y: Any, w: java.util.ArrayList) {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/createSetFromUsage2.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/createSetFromUsage2.kt.after
index 21a12da8b76f..057f482e0efc 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/createSetFromUsage2.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/createSetFromUsage2.kt.after
@@ -1,6 +1,7 @@
import java.util.ArrayList
// "Create extension function 'set'" "true"
+// ERROR: operator modifier is required on 'set' in ''
class Foo {
fun x (y: Any, w: java.util.ArrayList) {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/setterForIncrement.kt b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/setterForIncrement.kt
index 0ef85f51599e..99e411cc933e 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/setterForIncrement.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/setterForIncrement.kt
@@ -1,6 +1,6 @@
// "Create member function 'set'" "true"
class A {
- fun get(s: String): Int = 1
+ operator fun get(s: String): Int = 1
}
fun foo() {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/setterForIncrement.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/setterForIncrement.kt.after
index 5da19a2a03c5..8189d0c7195c 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/setterForIncrement.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/createFromUsage/createFunction/set/setterForIncrement.kt.after
@@ -1,6 +1,6 @@
// "Create member function 'set'" "true"
class A {
- fun get(s: String): Int = 1
+ operator fun get(s: String): Int = 1
operator fun set(s: String, value: Int) {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/infixCall.kt b/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/infixCall.kt
index 3d79856285b4..6891907895c3 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/infixCall.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/infixCall.kt
@@ -1,11 +1,11 @@
// "Replace with 'newFun(p, this)'" "true"
@Deprecated("", ReplaceWith("newFun(p, this)"))
-fun String.oldFun(p: Int) {
+infix fun String.oldFun(p: Int) {
newFun(p, this)
}
-fun newFun(p: Int, s: String){}
+infix fun newFun(p: Int, s: String){}
fun foo() {
"" oldFun 1
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/infixCall.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/infixCall.kt.after
index e08e8ac9bfb8..992a2c011c4c 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/infixCall.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/infixCall.kt.after
@@ -1,11 +1,11 @@
// "Replace with 'newFun(p, this)'" "true"
@Deprecated("", ReplaceWith("newFun(p, this)"))
-fun String.oldFun(p: Int) {
+infix fun String.oldFun(p: Int) {
newFun(p, this)
}
-fun newFun(p: Int, s: String){}
+infix fun newFun(p: Int, s: String){}
fun foo() {
newFun(1, "")
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/keepInfixCall.kt b/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/keepInfixCall.kt
index 287ed8f232cf..773e8b68329a 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/keepInfixCall.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/keepInfixCall.kt
@@ -1,11 +1,11 @@
// "Replace with 'newFun(p)'" "true"
@Deprecated("", ReplaceWith("newFun(p)"))
-fun String.oldFun(p: Int) {
+infix fun String.oldFun(p: Int) {
newFun(p)
}
-fun String.newFun(p: Int) {
+infix fun String.newFun(p: Int) {
}
fun foo() {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/keepInfixCall.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/keepInfixCall.kt.after
index 30e13b775afe..47d9ae9b7a31 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/keepInfixCall.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/keepInfixCall.kt.after
@@ -1,11 +1,11 @@
// "Replace with 'newFun(p)'" "true"
@Deprecated("", ReplaceWith("newFun(p)"))
-fun String.oldFun(p: Int) {
+infix fun String.oldFun(p: Int) {
newFun(p)
}
-fun String.newFun(p: Int) {
+infix fun String.newFun(p: Int) {
}
fun foo() {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/operatorCall.kt b/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/operatorCall.kt
index 752382dd590b..5eb5d3964487 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/operatorCall.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/operatorCall.kt
@@ -3,7 +3,7 @@
interface I
@Deprecated("", ReplaceWith("newFun(p, this)"))
-fun I.plus(p: Int) {
+operator fun I.plus(p: Int) {
newFun(p, this)
}
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/operatorCall.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/operatorCall.kt.after
index 032462576f8c..ad3a8c5c57d5 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/operatorCall.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/operatorCall.kt.after
@@ -3,7 +3,7 @@
interface I
@Deprecated("", ReplaceWith("newFun(p, this)"))
-fun I.plus(p: Int) {
+operator fun I.plus(p: Int) {
newFun(p, this)
}
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/operatorCall2.kt b/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/operatorCall2.kt
index b66bed1e17dd..52ce8247c213 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/operatorCall2.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/operatorCall2.kt
@@ -3,7 +3,7 @@
interface I
@Deprecated("", ReplaceWith("newFun(p)"))
-fun I.plus(p: Int) {
+operator fun I.plus(p: Int) {
newFun(p)
}
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/operatorCall2.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/operatorCall2.kt.after
index 7bbc85fe57e3..67628ba2f49b 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/operatorCall2.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/operatorCall2.kt.after
@@ -3,7 +3,7 @@
interface I
@Deprecated("", ReplaceWith("newFun(p)"))
-fun I.plus(p: Int) {
+operator fun I.plus(p: Int) {
newFun(p)
}
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/safeCall/changeThisSafeCallWithValue4Runtime.kt b/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/safeCall/changeThisSafeCallWithValue4Runtime.kt
index 1aad28563d3e..9b807a4ad441 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/safeCall/changeThisSafeCallWithValue4Runtime.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/safeCall/changeThisSafeCallWithValue4Runtime.kt
@@ -13,4 +13,4 @@ fun foo(s: String, t: X) {
}
}
-fun X.plus(x: X): X? = null
\ No newline at end of file
+operator fun X.plus(x: X): X? = null
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/safeCall/changeThisSafeCallWithValue4Runtime.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/safeCall/changeThisSafeCallWithValue4Runtime.kt.after
index fdddb49ab3c1..fb53686a27b3 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/safeCall/changeThisSafeCallWithValue4Runtime.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/deprecatedSymbolUsage/safeCall/changeThisSafeCallWithValue4Runtime.kt.after
@@ -13,4 +13,4 @@ fun foo(s: String, t: X) {
}
}
-fun X.plus(x: X): X? = null
\ No newline at end of file
+operator fun X.plus(x: X): X? = null
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/modifiers/deprecatedDelegatesGetSetMember.kt b/plugins/kotlin/idea/tests/testData/quickfix/modifiers/deprecatedDelegatesGetSetMember.kt
index 7118faeb80d9..737c9d7c871c 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/modifiers/deprecatedDelegatesGetSetMember.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/modifiers/deprecatedDelegatesGetSetMember.kt
@@ -1,4 +1,6 @@
// "Rename to 'setValue'" "true"
+// ERROR: 'get' method convention on type 'CustomDelegate' is deprecated. Rename to 'getValue'
+
class CustomDelegate {
operator fun get(thisRef: Any?, prop: PropertyMetadata): String = ""
operator fun set(thisRef: Any?, prop: PropertyMetadata, value: String) {}
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/modifiers/deprecatedDelegatesGetSetMember.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/modifiers/deprecatedDelegatesGetSetMember.kt.after
index a026f1eca945..485ed7e9dbf0 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/modifiers/deprecatedDelegatesGetSetMember.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/modifiers/deprecatedDelegatesGetSetMember.kt.after
@@ -1,4 +1,6 @@
// "Rename to 'setValue'" "true"
+// ERROR: 'get' method convention on type 'CustomDelegate' is deprecated. Rename to 'getValue'
+
class CustomDelegate {
operator fun get(thisRef: Any?, prop: PropertyMetadata): String = ""
operator fun setValue(thisRef: Any?, prop: PropertyMetadata, value: String) {}
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/modifiers/operatorModifierComponent.kt b/plugins/kotlin/idea/tests/testData/quickfix/modifiers/operatorModifierComponent.kt
index bb8d4ccf362d..a75e03ccaf48 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/modifiers/operatorModifierComponent.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/modifiers/operatorModifierComponent.kt
@@ -1,4 +1,6 @@
// "Add 'operator' modifier" "true"
+// ERROR: operator modifier is required on 'component2' in 'A'
+
class A {
fun component1(): Int = 0
fun component2(): Int = 1
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/modifiers/operatorModifierComponent.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/modifiers/operatorModifierComponent.kt.after
index 5352a016eabf..a8783f40f3bf 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/modifiers/operatorModifierComponent.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/modifiers/operatorModifierComponent.kt.after
@@ -1,4 +1,6 @@
// "Add 'operator' modifier" "true"
+// ERROR: operator modifier is required on 'component2' in 'A'
+
class A {
operator fun component1(): Int = 0
fun component2(): Int = 1
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/suppress/forStatement/infix.kt b/plugins/kotlin/idea/tests/testData/quickfix/suppress/forStatement/infix.kt
index 4175a8a4d54e..978ec50c27f5 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/suppress/forStatement/infix.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/suppress/forStatement/infix.kt
@@ -1,5 +1,7 @@
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
+infix fun Int.add(other: Int) = this + other
+
fun foo() {
- 1!! plus 2
+ 1!! add 2
}
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/suppress/forStatement/infix.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/suppress/forStatement/infix.kt.after
index bcef56f2ee60..0fe0d0a2b83b 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/suppress/forStatement/infix.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/suppress/forStatement/infix.kt.after
@@ -1,6 +1,8 @@
// "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true"
+infix fun Int.add(other: Int) = this + other
+
fun foo() {
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
- (1!! plus 2)
+ (1!! add 2)
}
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/anonymousObjectInInfixCall.kt b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/anonymousObjectInInfixCall.kt
index 36a7dc422b1d..3cf3fa65fe0b 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/anonymousObjectInInfixCall.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/anonymousObjectInInfixCall.kt
@@ -1,7 +1,7 @@
// "Change parameter 't' type of function 'foo' to 'T'" "true"
interface T
-fun Int.foo(t: Int) = this
+infix fun Int.foo(t: Int) = this
fun foo() {
1 foo object: T{}
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/anonymousObjectInInfixCall.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/anonymousObjectInInfixCall.kt.after
index 5f1e665ad0a4..af30fb5b3871 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/anonymousObjectInInfixCall.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/anonymousObjectInInfixCall.kt.after
@@ -1,7 +1,7 @@
// "Change parameter 't' type of function 'foo' to 'T'" "true"
interface T
-fun Int.foo(t: T) = this
+infix fun Int.foo(t: T) = this
fun foo() {
1 foo object: T{}
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/smartcastImpossible1.kt b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/smartcastImpossible1.kt
index 02e238fab022..cb1326959f1c 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/smartcastImpossible1.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/smartcastImpossible1.kt
@@ -1,7 +1,7 @@
// "Cast expression 'a' to 'Foo'" "true"
interface Foo {
- fun plus(x: Any) : Foo
+ operator fun plus(x: Any) : Foo
}
open class MyClass {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/smartcastImpossible1.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/smartcastImpossible1.kt.after
index 366f5681c6c9..7561148297a0 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/smartcastImpossible1.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/smartcastImpossible1.kt.after
@@ -1,7 +1,7 @@
// "Cast expression 'a' to 'Foo'" "true"
interface Foo {
- fun plus(x: Any) : Foo
+ operator fun plus(x: Any) : Foo
}
open class MyClass {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/smartcastImpossible2.kt b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/smartcastImpossible2.kt
index 2034e55a1e7b..34d769df8c5a 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/smartcastImpossible2.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/smartcastImpossible2.kt
@@ -1,7 +1,7 @@
// "Cast expression 'a' to 'Foo'" "true"
interface Foo {
- fun not() : Foo
+ operator fun not() : Foo
}
open class MyClass {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/smartcastImpossible2.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/smartcastImpossible2.kt.after
index 2756f99ef686..c7cbaa2e31f6 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/smartcastImpossible2.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/smartcastImpossible2.kt.after
@@ -1,7 +1,7 @@
// "Cast expression 'a' to 'Foo'" "true"
interface Foo {
- fun not() : Foo
+ operator fun not() : Foo
}
open class MyClass {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/typeMismatch3.kt b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/typeMismatch3.kt
index 47c3bc48e669..fa7a00140588 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/typeMismatch3.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/typeMismatch3.kt
@@ -1,6 +1,6 @@
// "Cast expression 'a + a' to 'B'" "true"
interface A {
- fun plus(x: Any): A
+ operator fun plus(x: Any): A
}
interface B : A
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/typeMismatch3.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/typeMismatch3.kt.after
index 491082178d1c..1591c8d4ab5b 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/typeMismatch3.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/casts/typeMismatch3.kt.after
@@ -1,9 +1,9 @@
// "Cast expression 'a + a' to 'B'" "true"
interface A {
- fun plus(x: Any): A
+ operator fun plus(x: Any): A
}
interface B : A
fun foo(a: A): B {
- return (a + a) as B
+ return (a + a) as B
}
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/changeReturnTypeWhenValueParameterListIsAbsent.kt b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/changeReturnTypeWhenValueParameterListIsAbsent.kt
index 1d71468c8d1d..fc311c4a57ee 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/changeReturnTypeWhenValueParameterListIsAbsent.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/changeReturnTypeWhenValueParameterListIsAbsent.kt
@@ -1,8 +1,8 @@
// "Change 'A.hasNext' function return type to 'Boolean'" "true"
abstract class A {
- abstract fun hasNext
- abstract fun next(): Int
- abstract fun iterator(): A
+ abstract operator fun hasNext
+ abstract operator fun next(): Int
+ abstract operator fun iterator(): A
}
fun test(notRange: A) {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/changeReturnTypeWhenValueParameterListIsAbsent.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/changeReturnTypeWhenValueParameterListIsAbsent.kt.after
index 9f6681c1b479..66a361bacc29 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/changeReturnTypeWhenValueParameterListIsAbsent.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/changeReturnTypeWhenValueParameterListIsAbsent.kt.after
@@ -1,8 +1,8 @@
// "Change 'A.hasNext' function return type to 'Boolean'" "true"
abstract class A {
- abstract fun hasNext: Boolean
- abstract fun next(): Int
- abstract fun iterator(): A
+ abstract operator fun hasNext: Boolean
+ abstract operator fun next(): Int
+ abstract operator fun iterator(): A
}
fun test(notRange: A) {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/compareToTypeMismatch.kt b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/compareToTypeMismatch.kt
index b8028798e72b..132f6a4be8bf 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/compareToTypeMismatch.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/compareToTypeMismatch.kt
@@ -1,6 +1,6 @@
// "Change 'A.compareTo' function return type to 'Int'" "true"
interface A {
- fun compareTo(other: Any): String
+ operator fun compareTo(other: Any): String
}
fun foo(x: A) {
if (x < 0) {}
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/compareToTypeMismatch.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/compareToTypeMismatch.kt.after
index 2e6777b4499e..1cccdee3d6b1 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/compareToTypeMismatch.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/compareToTypeMismatch.kt.after
@@ -1,6 +1,6 @@
// "Change 'A.compareTo' function return type to 'Int'" "true"
interface A {
- fun compareTo(other: Any): Int
+ operator fun compareTo(other: Any): Int
}
fun foo(x: A) {
if (x < 0) {}
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch1.kt b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch1.kt
index 717cfed960f6..2ae9beb442fc 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch1.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch1.kt
@@ -1,7 +1,7 @@
// "Change 'A.component1' function return type to 'Int'" "true"
abstract class A {
- abstract fun component1()
- abstract fun component2(): Int
+ abstract operator fun component1()
+ abstract operator fun component2(): Int
}
fun foo(a: A) {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch1.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch1.kt.after
index 3dcd795171a8..2397a242778e 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch1.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch1.kt.after
@@ -1,7 +1,7 @@
// "Change 'A.component1' function return type to 'Int'" "true"
abstract class A {
- abstract fun component1(): Int
- abstract fun component2(): Int
+ abstract operator fun component1(): Int
+ abstract operator fun component2(): Int
}
fun foo(a: A) {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch2.kt b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch2.kt
index e076e74cef61..d6938e1ce65d 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch2.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch2.kt
@@ -1,7 +1,7 @@
// "Change 'A.component2' function return type to 'Int'" "true"
abstract class A {
- abstract fun component1(): Int
- abstract fun component2(): String
+ abstract operator fun component1(): Int
+ abstract operator fun component2(): String
}
fun foo(a: A) {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch2.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch2.kt.after
index c83364f3b65e..d71e0c760e61 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch2.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch2.kt.after
@@ -1,7 +1,7 @@
// "Change 'A.component2' function return type to 'Int'" "true"
abstract class A {
- abstract fun component1(): Int
- abstract fun component2(): Int
+ abstract operator fun component1(): Int
+ abstract operator fun component2(): Int
}
fun foo(a: A) {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch3.kt b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch3.kt
index abadafb49e34..89b7b25c5d33 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch3.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch3.kt
@@ -1,7 +1,7 @@
// "Remove explicitly specified return type in 'A.component2' function" "true"
abstract class A {
- abstract fun component1(): Int
- abstract fun component2(): Int
+ abstract operator fun component1(): Int
+ abstract operator fun component2(): Int
}
fun foo(a: A) {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch3.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch3.kt.after
index 7d89eb6eaedb..9afa29bf3821 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch3.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch3.kt.after
@@ -1,7 +1,7 @@
// "Remove explicitly specified return type in 'A.component2' function" "true"
abstract class A {
- abstract fun component1(): Int
- abstract fun component2()
+ abstract operator fun component1(): Int
+ abstract operator fun component2()
}
fun foo(a: A) {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch4.kt b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch4.kt
index 7fcf869866ce..825aa7343b1a 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch4.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch4.kt
@@ -1,8 +1,8 @@
// "Change 'A.component2' function return type to 'Unit'" "true"
// ERROR: The integer literal does not conform to the expected type kotlin.Unit
abstract class A {
- abstract fun component1(): Int
- fun component2() = 42
+ abstract operator fun component1(): Int
+ operator fun component2() = 42
}
fun foo(a: A) {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch4.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch4.kt.after
index abbe2300836c..7ac9da58cae1 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch4.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch4.kt.after
@@ -1,8 +1,8 @@
// "Change 'A.component2' function return type to 'Unit'" "true"
// ERROR: The integer literal does not conform to the expected type kotlin.Unit
abstract class A {
- abstract fun component1(): Int
- fun component2(): Unit = 42
+ abstract operator fun component1(): Int
+ operator fun component2(): Unit = 42
}
fun foo(a: A) {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch5.kt b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch5.kt
index 822bc91c700c..3160166aa1a2 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch5.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch5.kt
@@ -1,8 +1,8 @@
// "Change 'y' type to 'Int'" "true"
class A {
- fun component1() = 42
- fun component2() = 42
- fun component3() = 42
+ operator fun component1() = 42
+ operator fun component2() = 42
+ operator fun component3() = 42
}
fun foo(a: A) {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch5.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch5.kt.after
index 503d3e31f01e..ea925d1d9063 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch5.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/componentFunctionReturnTypeMismatch/componentFunctionReturnTypeMismatch5.kt.after
@@ -1,8 +1,8 @@
// "Change 'y' type to 'Int'" "true"
class A {
- fun component1() = 42
- fun component2() = 42
- fun component3() = 42
+ operator fun component1() = 42
+ operator fun component2() = 42
+ operator fun component3() = 42
}
fun foo(a: A) {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changeNotFunctionReturnType.kt b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changeNotFunctionReturnType.kt
index 28c05b878bac..f2dcf7f7f724 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changeNotFunctionReturnType.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changeNotFunctionReturnType.kt
@@ -1,7 +1,7 @@
// "Change 'A.not' function return type to 'A'" "true"
interface A {
- fun not(): String
- fun times(a: A): A
+ operator fun not(): String
+ operator fun times(a: A): A
}
fun foo(a: A): A = a * !(if (true) a else a)
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changeNotFunctionReturnType.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changeNotFunctionReturnType.kt.after
index ce0594d5c617..d71164d274c6 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changeNotFunctionReturnType.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changeNotFunctionReturnType.kt.after
@@ -1,7 +1,7 @@
// "Change 'A.not' function return type to 'A'" "true"
interface A {
- fun not(): A
- fun times(a: A): A
+ operator fun not(): A
+ operator fun times(a: A): A
}
fun foo(a: A): A = a * !(if (true) a else a)
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changePlusFunctionReturnType.kt b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changePlusFunctionReturnType.kt
index e3915d9e301e..fdd335c4799b 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changePlusFunctionReturnType.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changePlusFunctionReturnType.kt
@@ -1,6 +1,6 @@
// "Change 'A.plus' function return type to '() -> Int'" "true"
interface A {
- fun plus(a: A): String
+ operator fun plus(a: A): String
}
fun foo(a: A): () -> Int {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changePlusFunctionReturnType.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changePlusFunctionReturnType.kt.after
index 38a92aec5e00..ddea04b0eb8b 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changePlusFunctionReturnType.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changePlusFunctionReturnType.kt.after
@@ -1,6 +1,6 @@
// "Change 'A.plus' function return type to '() -> Int'" "true"
interface A {
- fun plus(a: A): () -> Int
+ operator fun plus(a: A): () -> Int
}
fun foo(a: A): () -> Int {
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changeTimesFunctionParameterType.kt b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changeTimesFunctionParameterType.kt
index bc2f8b03cc24..5bed2b41d005 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changeTimesFunctionParameterType.kt
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changeTimesFunctionParameterType.kt
@@ -1,6 +1,6 @@
// "Change parameter 'a' type of function 'A.times' to 'String'" "true"
interface A {
- fun times(a: A): A
+ operator fun times(a: A): A
}
fun foo(a: A): A = a * ""
\ No newline at end of file
diff --git a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changeTimesFunctionParameterType.kt.after b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changeTimesFunctionParameterType.kt.after
index 252bb1d98bd9..0de4ca504ad3 100644
--- a/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changeTimesFunctionParameterType.kt.after
+++ b/plugins/kotlin/idea/tests/testData/quickfix/typeMismatch/fixOverloadedOperator/changeTimesFunctionParameterType.kt.after
@@ -1,6 +1,6 @@
// "Change parameter 'a' type of function 'A.times' to 'String'" "true"
interface A {
- fun times(a: String): A
+ operator fun times(a: String): A
}
fun foo(a: A): A = a *