https://kotlinlang.org logo
Title
j

jbnizet

10/10/2019, 6:37 AM
Suppose I want to use
for (date in d1..d2)
where d1 and d2 are instances of java.time.LocalDate. I can do that by defining an extension function
operator fun ClosedRange<LocalDate>.iterator()
. But is there a way to easily have that extension function imported in IntelliJ? Except for manually typing the import statement
import my.package.iterator
at the top of the file, I haven’t found a way, which makes it quite unintuitive to use such a for loop. Is there a better solution that I’m missing?
e

egorand

10/10/2019, 11:29 PM
IDE should definitely suggest to auto-import the function in this case. File an issue? https://youtrack.jetbrains.com/newIssue
j

jbnizet

10/11/2019, 10:14 AM
Thanks @egorand I will.