Scala Programming Language
  1. Scala Programming Language
  2. SI-4963

ArrayStack.apply creates unusable ArrayStack

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: Scala 2.9.0-1
    • Fix Version/s: None
    • Component/s: Collections
    • Labels:

      Description

      val x = ArrayStack[Int] // Uses ArrayStack apply(elem: T*) method
      When passed no elements creates ArrayStack with T[0]
      afterwards arraygrow doubles the number of elements which mean still T[0]

      Not a big a deal, but minimum size of 1 needs to be insured

        Activity

        Hide
        Commit Message Bot added a comment -

        (extempore in r25910) Fix ArrayStack.growArray at boundary.

        Doubling a 0-size array is still 0, that's not growing.
        Closes SI-4963, no review.

        Show
        Commit Message Bot added a comment - (extempore in r25910 ) Fix ArrayStack.growArray at boundary. Doubling a 0-size array is still 0, that's not growing. Closes SI-4963 , no review.

          People

          • Assignee:
            Paul Phillips
            Reporter:
            Dmitry Zaslavsky
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development