Skip to content

j.l.String.lines (introduced JDK 11) trumps StringOps.lines #557

Closed
@retronym

Description

@retronym
$ scala
Welcome to Scala 2.12.4 (Java HotSpot(TM) 64-Bit Server VM, Java 11-ea).
Type in expressions for evaluation. Or try :help.

scala> "".lines.toList
<console>:12: error: value toList is not a member of java.util.stream.Stream[String]
       "".lines.toList
                ^

scala> augmentString("").lines.toList
res1: List[String] = List()

scala> ("": collection.immutable.StringOps).lines.toList
res2: List[String] = List()

scala> "".linesIterator.toList
<console>:12: warning: method linesIterator in trait StringLike is deprecated (since 2.11.0): use `lines` instead
       "".linesIterator.toList
          ^
res3: List[String] = List()

I propose that we undeprecate linesIterator in 2.12, and restore it to 2.13 (where it was already removed).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions