Test fixes for 'New diagnostic error for ambiguous object expression type'

This commit is contained in:
Mikhael Bogdanov
2013-02-19 14:36:50 +04:00
parent 1662c5cb75
commit 029b2d9770
7 changed files with 88 additions and 56 deletions
@@ -1,9 +1,15 @@
fun <T : Any> T?.iterator() = object {
trait MyIterator<T> {
fun hasNext() : Boolean
fun next() : T
}
fun <T : Any> T?.iterator() = object : MyIterator<T> {
var hasNext = this@iterator != null
private set
fun hasNext() = hasNext
override fun hasNext() = hasNext
fun next() : T {
override fun next() : T {
if (hasNext) {
hasNext = false
return this@iterator!!