Skip to content

Commit e3c1618

Browse files
EnzeXinglrytz
EnzeXing
andcommitted
Add test and fix for initialization cycle
Co-authored-by: Lukas Rytz <lukas.rytz@gmail.com>
1 parent a4be3e8 commit e3c1618

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

library/src/scala/collection/immutable/Vector.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ object Vector extends StrictOptimizedSeqFactory[Vector] {
8181
}
8282

8383
private val defaultApplyPreferredMaxLength: Int =
84-
try System.getProperty("scala.collection.immutable.Vector.defaultApplyPreferredMaxLength",
85-
"250").toInt
84+
// explicit StringOps to avoid initialization cycle with Predef (scala/bug#13009)
85+
try new StringOps(System.getProperty("scala.collection.immutable.Vector.defaultApplyPreferredMaxLength",
86+
"250")).toInt
8687
catch {
8788
case _: SecurityException => 250
8889
}

0 commit comments

Comments
 (0)