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

Unused import thrown when using `` in import #910

Closed
jlvs-chirp opened this issue Sep 15, 2020 · 1 comment · Fixed by #911
Closed

Unused import thrown when using `` in import #910

jlvs-chirp opened this issue Sep 15, 2020 · 1 comment · Fixed by #911

Comments

@jlvs-chirp
Copy link

jlvs-chirp commented Sep 15, 2020

Expected Behavior

I expect the following code to pass lint check.

import com.test.`object`.Producer as Producer1

class Consumer(producer1: Producer1<String>) {
    val x = 1
}

Observed Behavior

But it fails with ktlint-repro/src/main/kotlin/Consumer.kt:1:1: Unused import

If I refactor com.test.`object`.Producer to a package name that does not require ` then ktlint passes.

Steps to Reproduce

Run ktlint on the above file.

Your Environment

  • Version of ktlint used: 0.39.0
  • Name and version (or code for custom task) of integration used (Gradle plugin, Maven plugin, command line, custom Gradle task): Gradle plugin "org.jlleitschuh.gradle.ktlint" version "9.4.0"
  • Version of Gradle used (if applicable): 6.1.1
  • Operating System and version: Mac OS
  • Link to your project (if it's a public repository): N/A
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
2 participants