Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Scala 2.9.1, Scala 2.10.0-M2
    • Fix Version/s: Scala 2.10.0
    • Component/s: Collections
    • Labels:

      Description

      println(Seq(Array('1','2','3'), Array('a','b','c')).view.addString(new StringBuilder, "_"))
      

      I expect it print "123_abc", but I got "...".

        Activity

        Hide
        Paul Phillips added a comment -

        Surely it is apparent this behavior does not arise by accident. If you want the contents, force the view. (It still won't print 123_abc because it contains arrays, but that's not a bug either.)

        Show
        Paul Phillips added a comment - Surely it is apparent this behavior does not arise by accident. If you want the contents, force the view. (It still won't print 123_abc because it contains arrays, but that's not a bug either.)
        Hide
        杨博 added a comment -

        Only "transformer methods" have diffent behaviors, and `addString` is not a transformer method. "addString" should works as usual. See http://www.scala-lang.org/docu/files/collections-api/collections_42.html

        Show
        杨博 added a comment - Only "transformer methods" have diffent behaviors, and `addString` is not a transformer method. "addString" should works as usual. See http://www.scala-lang.org/docu/files/collections-api/collections_42.html
        Hide
        Paul Phillips added a comment -

        OK, since I don't whether that is true, reopening and assigning to reviewer.

        Show
        Paul Phillips added a comment - OK, since I don't whether that is true, reopening and assigning to reviewer.
        Hide
        Hubert Plociniczak added a comment -

        Alex can you decide what is the correct behaviour, please?

        Show
        Hubert Plociniczak added a comment - Alex can you decide what is the correct behaviour, please?
        Hide
        Aleksandar Prokopec added a comment -

        I'm unsure why `addString` was overridden in `ViewMkString` to add `...`.
        It does not seem consistent with the fact that `mkString` does force the view contents.

        I would say that `addString` should force the view, just like `mkString`.

        Show
        Aleksandar Prokopec added a comment - I'm unsure why `addString` was overridden in `ViewMkString` to add `...`. It does not seem consistent with the fact that `mkString` does force the view contents. I would say that `addString` should force the view, just like `mkString`.
        Hide
        Aleksandar Prokopec added a comment -

        And I can't seem to find any place where forcing behaviour for `addString` would break existing code.

        Show
        Aleksandar Prokopec added a comment - And I can't seem to find any place where forcing behaviour for `addString` would break existing code.

          People

          • Assignee:
            Aleksandar Prokopec
            Reporter:
            杨博
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development