Permalink
Browse files

SI-7373 Make the constructor of Vector non-public

The danger of:

   new Vector(1, 2, 3).toString
   java.lang.NullPointerException

and the "should have been private all along" argument
call for a break in the source compatibility policy here.
  • Loading branch information...
1 parent 6c63ab1 commit 1071d0ca86e21028efc1d51447935573b9f8490a @retronym retronym committed Dec 3, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/library/scala/collection/immutable/Vector.scala
@@ -59,7 +59,7 @@ object Vector extends IndexedSeqFactory[Vector] {
* @define mayNotTerminateInf
* @define willNotTerminateInf
*/
-final class Vector[+A](private[collection] val startIndex: Int, private[collection] val endIndex: Int, focus: Int)
+final class Vector[+A] private[immutable] (private[collection] val startIndex: Int, private[collection] val endIndex: Int, focus: Int)
extends AbstractSeq[A]
with IndexedSeq[A]
with GenericTraversableTemplate[A, Vector]

0 comments on commit 1071d0c

Please sign in to comment.