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
@@ -2,12 +2,12 @@ package foo
class Iter(val upper: Int) {
var count: Int = 0
fun hasNext(): Boolean = count < upper
fun next(): Int = count++
operator fun hasNext(): Boolean = count < upper
operator fun next(): Int = count++
}
class A(val upper: Int) {
fun iterator(): Iter = Iter(upper)
operator fun iterator(): Iter = Iter(upper)
}
fun box(): String {
@@ -3,18 +3,18 @@ package foo
var log = ""
class T(val id: Int) {
fun component1(): Int {
operator fun component1(): Int {
log += "($id).component1();"
return 1
}
fun component2(): String {
operator fun component2(): String {
log += "($id).component2();"
return "1"
}
}
class C {
fun iterator(): Iterator<T> = object: Iterator<T> {
operator fun iterator(): Iterator<T> = object: Iterator<T> {
var i = 0
var data = arrayOf(T(3), T(1), T(2))
override fun hasNext(): Boolean {