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

mutable.IndexedSeq.view.map returns collection.SeqView

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Scala 2.13.0-M1
    • Component/s: None
    • Labels:
      None

      Description

      === What steps will reproduce the problem (please be specific and use wikiformatting)? ===

      import collection.mutable._
       
      val x: ArrayBuffer[String] = ArrayBuffer("a", "b", "c")
      val y: IndexedSeq[String] = x.view map (_ + "0")
      

      This code compiles but produces a `ClassCastException` in the last line:

      java.lang.ClassCastException: scala.collection.SeqViewLike$$$$anon$$3 cannot be cast to scala.collection.mutable.IndexedSeq
      

      === What is the expected behavior? ===
      A compiler error or working code.

      === What versions of the following are you using? ===

      • Scala: 2.8.1

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ichoran Rex Kerr
                Reporter:
                jrudolph Johannes Rudolph
                TracCC:
                Ismael Juma
              • Votes:
                0 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated: