Skip to content

Fix unused imports #143

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

Merged
merged 1 commit into from
Apr 25, 2017
Merged

Fix unused imports #143

merged 1 commit into from
Apr 25, 2017

Conversation

ashawley
Copy link
Member

More warnings are enabled by default linter starting in Scala 2.12.2

See scala/scala#5402

More warnings by default linter starting in Scala 2.12.2
@lrytz lrytz merged commit 2ee8750 into scala:master Apr 25, 2017
@ashawley
Copy link
Member Author

I'm not so sure this was ready to go, we'll see though.

@@ -105,7 +104,7 @@ object Utility extends AnyRef with parsing.TokenTests {
val escMap = pairs map { case (s, c) => c -> ("&%s;" format s) }
val unescMap = pairs ++ Map("apos" -> '\'')
}
import Escapes.{ escMap, unescMap }
import Escapes.unescMap
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the claim that escMap was unused was a bit apocryphal on the compiler's part.

Can the compiler determine if an import is unused by other source files as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I'm wrong. The implementation really didn't use escMap. It's that #102 wanted to start using it again, and couldn't find it. We're good here!

@ashawley
Copy link
Member Author

I'm not so sure this was ready to go, we'll see though.

I was mistaken, the compiler was right. My faith is restored. I never should have doubted the gods.

@lrytz
Copy link
Member

lrytz commented Apr 25, 2017

Sorry I rushed this one :-) It looked good to me. The reason I wanted to get it in is that the latest version of the sbt-scala-modules plugin actually enables -Xlint (while previous versions tried to do it, but failed due to a misconfiguration), and in 2.12.2, -Xlint now warns about unused imports.

@ashawley
Copy link
Member Author

No worries at all. In the future I'll try to remember to mark it WIP.

I'm on board for both linting and for reducing warnings, so whatever it takes I'm for it. :)

@ashawley ashawley mentioned this pull request May 6, 2017
@ashawley ashawley deleted the warn-unused-import branch May 11, 2017 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants