Fix tests: "infix modifier required" and "operator modifier required" errors
This commit is contained in:
@@ -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
|
||||
|
||||
<selection>fun f(a: A) {
|
||||
a + a
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
a.ext
|
||||
a.infix
|
||||
a.minus
|
||||
a.p
|
||||
a.plus
|
||||
a.unaryMinus
|
||||
+3
-3
@@ -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
|
||||
|
||||
+3
-3
@@ -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
|
||||
|
||||
+3
-3
@@ -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()
|
||||
|
||||
<selection>fun f() {
|
||||
for (i in A()) {
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package a
|
||||
class A {
|
||||
}
|
||||
|
||||
fun A.get(s: String) {
|
||||
operator fun A.get(s: String) {
|
||||
}
|
||||
|
||||
<selection>fun f() {
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package a
|
||||
class A {
|
||||
}
|
||||
|
||||
fun A.invoke() {
|
||||
operator fun A.invoke() {
|
||||
}
|
||||
|
||||
<selection>fun f(a: A) {
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
<selection>fun f() {
|
||||
val (a, b) = A()
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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
|
||||
|
||||
<selection>fun A.iterator() = B()
|
||||
<selection>operator fun A.iterator() = B()
|
||||
|
||||
fun f() {
|
||||
for (i in A()) {
|
||||
|
||||
Reference in New Issue
Block a user