Skip to content

Commit f152056

Browse files
committed
Trim down Seq migration recommendations
1 parent c7aef3f commit f152056

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

_overviews/core/collections-migration-213.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,16 @@ available for migrating the usage sites are the following:
6060

6161
The first, in some ways simplest, migration strategy for all non-varargs usages of `scala.Seq` is to replace
6262
them with `scala.collection.Seq` (and require users to call `.toSeq` or `unsafeWrapArray` when passing such
63-
sequences to varargs methods). We recommend, in order of preference, doing such a replacement with one of:
63+
sequences to varargs methods).
6464

65-
- `import scala.{ collection => sc }` and using `sc.Seq`
66-
- `import scala.collection.{ Seq => CSeq }` and using `CSeq`
67-
- replacing `Seq[...]` usage with the fully-qualified `scala.collection.Seq[...]` (e.g. in code gen or macros)
68-
- `import scala.collection.Seq`, which shadows `scala.Seq` and is a 1-line change, but causes name confusion
65+
We recommend using `import scala.{ collection => sc }` and using `sc.Seq`, or `import scala.collection.{ Seq =>
66+
CSeq }` and `CSeq`.
6967

70-
As an example, it would look something like this:
68+
We recommend against using `import scala.collection.Seq`, which shadows the automatically imported `scala.Seq`,
69+
because even if it's a oneline change it causes name confusion. For code generation or macros the safest option
70+
is using the fully-qualified `_root_.scala.collection.Seq`.
71+
72+
As an example, the migration would look something like this:
7173

7274
~~~ scala
7375
import scala.{ collection => sc }

0 commit comments

Comments
 (0)