We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Suppose I have an extension method that adds an iterator to some type:
operator fun <T> Foo<T>?.iterator() { ... }
In another package, I want to iterate using this in a for loop:
for
import com.example.foo.iterator ... val foo : Foo = ... for (x in foo) { ... }
With the import the code compiles and works, but ktlint fails with an "Unused import" error.
Without the import, the Kotlin compiler fails with "Error:(...) Kotlin: For-loop range must have an 'iterator()' method").
This probably happens with other operator extension functions that are called implicitly, though I haven't tested.
operator
The text was updated successfully, but these errors were encountered:
@xenomachina Thank you. I'll take care of it after work.
Sorry, something went wrong.
Fixed false position unused "iterator" import detection (#40)
f9186c0
Fixed in 0.6.2 🎉
standard:no-unused-imports
org.gradle.kotlin.dsl.assign
No branches or pull requests
Suppose I have an extension method that adds an iterator to some type:
In another package, I want to iterate using this in a
for
loop:With the import the code compiles and works, but ktlint fails with an "Unused import" error.
Without the import, the Kotlin compiler fails with "Error:(...) Kotlin: For-loop range must have an 'iterator()' method").
This probably happens with other
operator
extension functions that are called implicitly, though I haven't tested.The text was updated successfully, but these errors were encountered: