// "Create member function 'Foo.iterator'" "true" class Foo { operator fun iterator(): Iterator { TODO("not implemented") //To change body of created functions use File | Settings | File Templates. } } fun foo() { for (i in Foo()) { bar(i) } } fun bar(i: String) { }