Skip to content
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

UnusedImports: False negative when importing class in same package #985

Closed
marianosimone opened this issue Jul 7, 2018 · 3 comments
Closed

Comments

@marianosimone
Copy link
Contributor

For the following files

package test

import test.A

val a = A()
package test

class A

Expected Behavior

The import test.A should be reported, as both files share the same package

Current Behavior

Nothing is reported

Your Environment

  • Version used: 1.0.0-RC7-3
@marianosimone
Copy link
Contributor Author

I do have a working solution for this, but I'd like to do some refactoring on the rule before introducing my change (specially around style and use of mutable classes). Would it be OK to submit a PR for the refactor first?

@arturbosch
Copy link
Member

go for it :)

arturbosch pushed a commit that referenced this issue Jul 13, 2018
Imports in the same package are unnecessary, and can be safely removed
Fixes #985
@arturbosch arturbosch added this to the RC8 milestone Sep 10, 2018
DSamaryan pushed a commit to DSamaryan/detekt that referenced this issue Oct 18, 2018
Imports in the same package are unnecessary, and can be safely removed
Fixes detekt#985
@lock
Copy link

lock bot commented Jun 20, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related topics.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants