Skip to content
New issue

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

False positive from UnusedImports on provideDelegate operator functions #669

Closed
eskatos opened this issue Dec 12, 2019 · 1 comment · Fixed by #784
Closed

False positive from UnusedImports on provideDelegate operator functions #669

eskatos opened this issue Dec 12, 2019 · 1 comment · Fixed by #784
Labels

Comments

@eskatos
Copy link

eskatos commented Dec 12, 2019

The fix for #506 in b997561 hardcoded the org.gradle.kotlin.dsl.provideDelegate import but provideDelegate operator functions aren't limited to org.gradle.kotlin.dsl and could be present in any Kotlin library.

See https://kotlinlang.org/docs/reference/delegated-properties.html#providing-a-delegate-since-11

The fix should be extended to any import of a provideDelegate operator function.

eskatos referenced this issue Dec 12, 2019
…le (#513)

* Allow unreferenced provideDelegate if there is a by keyword in the file

Fixes #506

* fix test
@JakeWharton
Copy link
Contributor

I currently have this problem in diffuse (git SHA ac5f1aa2c8cdcbb00beb0f3515201eb583385c77) from use of the Clikt library:

https://github.com/JakeWharton/diffuse/blob/ac5f1aa2c8cdcbb00beb0f3515201eb583385c77/diffuse/src/main/kotlin/com/jakewharton/diffuse/diffuse.kt#L10

> Task :diffuse:ktlintMainSourceSetCheck FAILED
/Volumes/dev/JakeWharton/diffuse/diffuse/src/main/kotlin/com/jakewharton/diffuse/diffuse.kt:10:1: Unused import

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants