Import quick fix: support extension iterator function

#KT-34303 Fixed
This commit is contained in:
Toshiaki Kameyama
2019-10-28 12:45:42 +09:00
committed by Dmitry Gridin
parent 3abfe59d75
commit 68ea677cc4
6 changed files with 47 additions and 0 deletions
@@ -0,0 +1,12 @@
// "Import" "true"
// ERROR: For-loop range must have an 'iterator()' method
// WITH_RUNTIME
package bar
import foo.Foo
import foo.iterator
fun foo(start: Foo, end: Foo) {
for (date in start<caret>..end) {}
}
@@ -0,0 +1,7 @@
package foo
class Foo : Comparable<Foo> {
override fun compareTo(other: Foo): Int = TODO()
}
operator fun ClosedRange<Foo>.iterator(): Iterator<Foo> = TODO()
@@ -0,0 +1,11 @@
// "Import" "true"
// ERROR: For-loop range must have an 'iterator()' method
// WITH_RUNTIME
package bar
import foo.Foo
fun foo(start: Foo, end: Foo) {
for (date in start<caret>..end) {}
}