-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
false positive for unused import #204
Comments
$ cat A.kt
import x.y.z.ThatClass
fun main() {
val response = config.restTemplate.postForEntity(uri, excel, ThatClass::class.java)
}
$ ktlint A.kt
// no errors printed Please provide a complete example. |
I've seen this happen as well. It was dealing with a val in one file, and using it in another package. I'll see if I can come up with a minimal sample to reproduce. |
So it has to do with the naming of things. package jaynewstrom.minimal.another
import jaynewstrom.minimal.anotherThing
class Foo {
val bar = anotherThing
} And package jaynewstrom.minimal
internal val anotherThing = "" This minimal sample will reproduce it. Notice these are in different packages, and the name of the val has the name of the nested package in it. |
Thank you, Jay! I'll have a fix shortly. |
Fixed in 0.23.0. |
I use the class for which I get the report like this:
val response = config.restTemplate.postForEntity(uri, excel, ThatClass::class.java)
The text was updated successfully, but these errors were encountered: