Skip to content

Commit

Permalink
Use explicit type in JsonParserSpecJvm for Scala 2.10
Browse files Browse the repository at this point in the history
  • Loading branch information
raboof committed Nov 16, 2021
1 parent a363745 commit 4182ee3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ class JsonParserSpecJvm extends Specification {
queue.peek
}

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

val maxDepth = i / 4 // should give lots of room
Expand Down

0 comments on commit 4182ee3

Please sign in to comment.