Skip to content

Commit

Permalink
Merge pull request #562 from nightscape/patch-1
Browse files Browse the repository at this point in the history
Mention how to prevent unused import warnings
  • Loading branch information
julienrf committed Oct 18, 2022
2 parents d6723b2 + 98afde4 commit 505c637
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ scalacOptions += "-P:semanticdb:synthetics:on"
> scalafixAll dependency:Collection213CrossCompat@org.scala-lang.modules:scala-collection-migrations:<version>
```

### Fixing unused import warnings
In Scala 2.13 the `import scala.collection.compat._` sometimes is not needed (e.g. `.to(SeqType)` is natively available).
This leads to a `unused import` warning under Scala 2.13 even though the import is required for Scala 2.12.
In order to work around this, you can pass a compiler option to ignore this specific issue, e.g. in SBT:
```scala
scalacOptions += "-Wconf:origin=scala.collection.compat.*:s"
```

### Contributing

The migration tool is not exhaustive. Contributions of additional rewrites are welcome. If you encounter a use case that’s not supported, please report it as described in the [contributing
Expand Down

0 comments on commit 505c637

Please sign in to comment.