Skip to content

Commit a6b1d8c

Browse files
committed
Use explicit type in JsonParserSpecJvm for Scala 2.10
1 parent a363745 commit a6b1d8c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spray-json/jvm/src/test/scala/spray/json/JsonParserSpecJvm.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ class JsonParserSpecJvm extends Specification {
6060
queue.peek
6161
}
6262

63-
val i: Int = Iterator.iterate(1)(1.+).indexWhere(depth => probe(depth, maxDepth = 1000) contains "stackoverflow")
63+
// Explicit type needed to compile on Scala 2.10, can be inlined later
64+
def inc(i: Int): Int = 1 + i
65+
val i: Int = Iterator.iterate(1)(inc).indexWhere(depth => probe(depth, maxDepth = 1000) contains "stackoverflow")
6466
println(s"Overflowing stack at $i which means we need about ${stackSize / i} bytes per recursive call")
6567

6668
val maxDepth = i / 4 // should give lots of room

0 commit comments

Comments
 (0)