Import quick fix: support extension iterator function
#KT-34303 Fixed
This commit is contained in:
committed by
Dmitry Gridin
parent
3abfe59d75
commit
68ea677cc4
@@ -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) {}
|
||||
}
|
||||
Reference in New Issue
Block a user