quickfix for usages of operators that don't have the proper annotation
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
// "Add 'operator' modifier" "true"
|
||||
class A {
|
||||
fun plus(a: A): A = A()
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
A() <caret>+ A()
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Add 'operator' modifier" "true"
|
||||
class A {
|
||||
operator fun plus(a: A): A = A()
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
A() <caret>+ A()
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Add 'operator' modifier" "true"
|
||||
class A {
|
||||
fun contains(x: Any): Boolean = false
|
||||
}
|
||||
|
||||
fun foo() = 0 i<caret>n A()
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Add 'operator' modifier" "true"
|
||||
class A {
|
||||
operator fun contains(x: Any): Boolean = false
|
||||
}
|
||||
|
||||
fun foo() = 0 in A()
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Add 'operator' modifier" "true"
|
||||
class A {
|
||||
fun component1(): Int = 0
|
||||
fun component2(): Int = 1
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
val (<caret>zero, one) = A()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Add 'operator' modifier" "true"
|
||||
class A {
|
||||
operator fun component1(): Int = 0
|
||||
fun component2(): Int = 1
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
val (zero, one) = A()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Add 'operator' modifier" "true"
|
||||
class A {
|
||||
fun get(i: Int): String = ""
|
||||
}
|
||||
|
||||
fun foo() = A()<caret>[0]
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Add 'operator' modifier" "true"
|
||||
class A {
|
||||
operator fun get(i: Int): String = ""
|
||||
}
|
||||
|
||||
fun foo() = A()[0]
|
||||
Reference in New Issue
Block a user