Fix tests: "infix modifier required" and "operator modifier required" errors

This commit is contained in:
Yan Zhulanow
2015-11-26 15:56:56 +03:00
parent a3ff3ffc45
commit 9d1af5a17e
635 changed files with 1283 additions and 1617 deletions
@@ -1,4 +1,5 @@
// "Create member function 'foo'" "true"
// ERROR: infix modifier is required on 'foo' in 'A'
class A<T>(val n: T)
@@ -1,4 +1,5 @@
// "Create member function 'foo'" "true"
// ERROR: infix modifier is required on 'foo' in 'A'
class A<T>(val n: T) {
infix fun foo(t: T): A<T> {
@@ -1,4 +1,6 @@
// "Create extension function '!u00A0'" "true"
// ERROR: infix modifier is required on '!u00A0' in ''
fun test() {
val t: Int = 1 <caret>`!u00A0` 2
}
@@ -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
}
@@ -1,7 +1,7 @@
// "Create member function 'component3'" "true"
class Foo<T> {
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<caret><Int>()
@@ -1,7 +1,7 @@
// "Create member function 'component3'" "true"
class Foo<T> {
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.
@@ -1,7 +1,7 @@
// "Create member function 'component3'" "true"
class Foo<T> {
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<caret><Int>()
@@ -1,7 +1,7 @@
// "Create member function 'component3'" "true"
class Foo<T> {
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.
@@ -1,16 +1,16 @@
// "Create extension function 'component2'" "true"
class FooIterator<T> {
fun hasNext(): Boolean { return false }
fun next(): Any {
operator fun hasNext(): Boolean { return false }
operator fun next(): Any {
throw UnsupportedOperationException("not implemented")
}
}
class Foo<T> {
fun iterator(): FooIterator<String> {
operator fun iterator(): FooIterator<String> {
throw UnsupportedOperationException("not implemented")
}
}
fun Any.component1(): Int {
operator fun Any.component1(): Int {
return 0
}
fun foo() {
@@ -1,16 +1,16 @@
// "Create extension function 'component2'" "true"
class FooIterator<T> {
fun hasNext(): Boolean { return false }
fun next(): Any {
operator fun hasNext(): Boolean { return false }
operator fun next(): Any {
throw UnsupportedOperationException("not implemented")
}
}
class Foo<T> {
fun iterator(): FooIterator<String> {
operator fun iterator(): FooIterator<String> {
throw UnsupportedOperationException("not implemented")
}
}
fun Any.component1(): Int {
operator fun Any.component1(): Int {
return 0
}
fun foo() {
@@ -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 {
@@ -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.
@@ -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 {
@@ -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.
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
// ERROR: operator modifier is required on 'get' in 'Foo'
class Foo<T> {
fun x (y: Foo<Iterable<T>>) {
val z: Iterable<T> = y<caret>[""]
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
// ERROR: operator modifier is required on 'get' in 'Foo'
class Foo<T> {
fun x (y: Foo<Iterable<T>>) {
val z: Iterable<T> = y[""]
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
// ERROR: operator modifier is required on 'get' in 'Foo'
class Foo<T> {
fun <T> x (y: Foo<List<T>>, w: java.util.ArrayList<T>) {
val z: Iterable<T> = y<caret>["", w]
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
// ERROR: operator modifier is required on 'get' in 'Foo'
class Foo<T> {
fun <T> x (y: Foo<List<T>>, w: java.util.ArrayList<T>) {
val z: Iterable<T> = y["", w]
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
// ERROR: operator modifier is required on 'get' in 'Foo'
class Foo<T>
fun <T> x (y: Foo<List<T>>, w: java.util.ArrayList<T>) {
val z: Iterable<T> = y<caret>["", w]
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
// ERROR: operator modifier is required on 'get' in 'Foo'
class Foo<T> {
operator fun get(s: String, w: T): T {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
// ERROR: operator modifier is required on 'get' in 'Foo'
class Foo<T>
fun <T> x (y: Foo<List<T>>, w: java.util.ArrayList<T>) {
val z = y<caret>["", w]
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
// ERROR: operator modifier is required on 'get' in 'Foo'
class Foo<T> {
operator fun get(s: String, w: T): Any {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
// ERROR: operator modifier is required on 'get' in 'Foo'
import java.util.ArrayList
class Foo<T> {
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
// ERROR: operator modifier is required on 'get' in 'Foo'
import java.util.ArrayList
class Foo<T> {
@@ -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<caret>[""]
}
@@ -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[""]
}
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
// ERROR: operator modifier is required on 'get' in 'Foo'
class Foo<T> {
fun <S> x (y: Foo<Iterable<S>>) {
val z: Iterable<S> = y<caret>[""]
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
// ERROR: operator modifier is required on 'get' in 'Foo'
class Foo<T> {
fun <S> x (y: Foo<Iterable<S>>) {
val z: Iterable<S> = y[""]
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
// ERROR: operator modifier is required on 'get' in 'Foo'
class Foo<T, S: Iterable<T>> {
fun <U> x (y: Foo<U, Iterable<U>>) {
val z: U = y<caret>[""]
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
// ERROR: operator modifier is required on 'get' in 'Foo'
class Foo<T, S: Iterable<T>> {
fun <U> x (y: Foo<U, Iterable<U>>) {
val z: U = y[""]
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
// ERROR: operator modifier is required on 'get' in 'Foo'
class Foo<T> {
fun <T, V> x (y: Foo<Iterable<T>>, w: Iterable<V>) {
val z: Iterable<T> = y<caret>["", w]
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
// ERROR: operator modifier is required on 'get' in 'Foo'
class Foo<T> {
fun <T, V> x (y: Foo<Iterable<T>>, w: Iterable<V>) {
val z: Iterable<T> = y["", w]
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
// ERROR: operator modifier is required on 'get' in 'Foo'
import java.util.ArrayList
class Foo<T> {
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
// ERROR: operator modifier is required on 'get' in 'Foo'
import java.util.ArrayList
class Foo<T> {
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
// ERROR: operator modifier is required on 'get' in 'Foo'
import java.util.ArrayList
class Foo<T> {
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
// ERROR: operator modifier is required on 'get' in 'Foo'
import java.util.ArrayList
class Foo<T> {
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
// ERROR: operator modifier is required on 'get' in 'Foo'
import java.util.ArrayList
class Foo<S> {
@@ -1,4 +1,6 @@
// "Create member function 'get'" "true"
// ERROR: operator modifier is required on 'get' in 'Foo'
import java.util.ArrayList
class Foo<S> {
@@ -1,11 +1,11 @@
// "Create member function 'hasNext'" "true"
class FooIterator<T> {
fun next(): Int {
operator fun next(): Int {
throw Exception("not implemented")
}
}
class Foo<T> {
fun iterator(): FooIterator<String> {
operator fun iterator(): FooIterator<String> {
throw Exception("not implemented")
}
}
@@ -1,6 +1,6 @@
// "Create member function 'hasNext'" "true"
class FooIterator<T> {
fun next(): Int {
operator fun next(): Int {
throw Exception("not implemented")
}
@@ -9,7 +9,7 @@ class FooIterator<T> {
}
}
class Foo<T> {
fun iterator(): FooIterator<String> {
operator fun iterator(): FooIterator<String> {
throw Exception("not implemented")
}
}
@@ -1,11 +1,11 @@
// "Create member function 'hasNext'" "true"
class FooIterator<T> {
fun next(): T {
operator fun next(): T {
throw Exception("not implemented")
}
}
class Foo<T> {
fun iterator(): FooIterator<T> {
operator fun iterator(): FooIterator<T> {
throw Exception("not implemented")
}
}
@@ -1,6 +1,6 @@
// "Create member function 'hasNext'" "true"
class FooIterator<T> {
fun next(): T {
operator fun next(): T {
throw Exception("not implemented")
}
@@ -9,7 +9,7 @@ class FooIterator<T> {
}
}
class Foo<T> {
fun iterator(): FooIterator<T> {
operator fun iterator(): FooIterator<T> {
throw Exception("not implemented")
}
}
@@ -1,16 +1,16 @@
// "Create member function 'next'" "true"
class FooIterator<T> {
fun hasNext(): Boolean { return false }
operator fun hasNext(): Boolean { return false }
}
class Foo<T> {
fun iterator(): FooIterator<String> {
operator fun iterator(): FooIterator<String> {
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() {
@@ -1,20 +1,20 @@
// "Create member function 'next'" "true"
class FooIterator<T> {
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<T> {
fun iterator(): FooIterator<String> {
operator fun iterator(): FooIterator<String> {
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() {
@@ -1,9 +1,9 @@
// "Create member function 'next'" "true"
class FooIterator<T> {
fun hasNext(): Boolean { return false }
operator fun hasNext(): Boolean { return false }
}
class Foo<T> {
fun iterator(): FooIterator<String> {
operator fun iterator(): FooIterator<String> {
throw Exception("not implemented")
}
}
@@ -1,13 +1,13 @@
// "Create member function 'next'" "true"
class FooIterator<T> {
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<T> {
fun iterator(): FooIterator<String> {
operator fun iterator(): FooIterator<String> {
throw Exception("not implemented")
}
}
@@ -1,9 +1,9 @@
// "Create member function 'next'" "true"
class FooIterator<T> {
fun hasNext(): Boolean { return false }
operator fun hasNext(): Boolean { return false }
}
class Foo<T> {
fun iterator(): FooIterator<T> {
operator fun iterator(): FooIterator<T> {
throw Exception("not implemented")
}
}
@@ -1,13 +1,13 @@
// "Create member function 'next'" "true"
class FooIterator<T> {
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<T> {
fun iterator(): FooIterator<T> {
operator fun iterator(): FooIterator<T> {
throw Exception("not implemented")
}
}
@@ -1,4 +1,6 @@
// "Create member function 'set'" "true"
// ERROR: operator modifier is required on 'set' in 'Foo'
class Foo<T> {
fun <T> x (y: Foo<List<T>>, w: java.util.ArrayList<T>) {
y<caret>["", w] = w
@@ -1,4 +1,6 @@
// "Create member function 'set'" "true"
// ERROR: operator modifier is required on 'set' in 'Foo'
class Foo<T> {
fun <T> x (y: Foo<List<T>>, w: java.util.ArrayList<T>) {
y["", w] = w
@@ -1,4 +1,5 @@
// "Create extension function 'set'" "true"
// ERROR: operator modifier is required on 'set' in ''
class Foo<T> {
fun <T> x (y: Any, w: java.util.ArrayList<T>) {
@@ -1,6 +1,7 @@
import java.util.ArrayList
// "Create extension function 'set'" "true"
// ERROR: operator modifier is required on 'set' in ''
class Foo<T> {
fun <T> x (y: Any, w: java.util.ArrayList<T>) {
@@ -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() {
@@ -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.