Skip to content

Commit 505c637

Browse files
authored
Merge pull request #562 from nightscape/patch-1
Mention how to prevent unused import warnings
2 parents d6723b2 + 98afde4 commit 505c637

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ scalacOptions += "-P:semanticdb:synthetics:on"
9090
> scalafixAll dependency:[email protected]:scala-collection-migrations:<version>
9191
```
9292

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

95103
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

0 commit comments

Comments
 (0)