Uploaded image for project: 'Scala Programming Language'
  1. Scala Programming Language
  2. SI-9773

StringLike.linesWithSeparators gives wrong result for the empty string

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Scala 2.11.8, Scala 2.12.0-M3
    • Fix Version/s: Scala 2.12.0-M5
    • Component/s: Library (Misc)
    • Labels:
      None

      Description

      According to http://www.scala-lang.org/api/2.11.8/index.html#scala.collection.immutable.StringLike@linesWithSeparators:Iterator[String], "The number of strings returned is one greater than the number of line end characters in this string. For an empty string, a single empty line is returned."

      But in fact, `"".linesWithSeparators` is an empty iterator.

      Either documentation or implementation has to be fixed. On one hand, the documented behavior is what I expected before reading, but on the other there probably are applications/libraries relying on the current one...

        Attachments

          Activity

            People

            • Assignee:
              apm A. P. Marki
              Reporter:
              alexey_r Alexey Romanov
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: