I am trying to build a Scala project on IntelliJ using Gradle. I am able to make but compile keeps failing with a stack overflow error.
I looked through other posts with similar issues which suggested increasing heap/stack size (this and this). So far I have tried setting these in JAVA_OPTS and idea64.exe.vmoptions.
-Xss512m -Xms512m -Xmx2048m -XX:ReservedCodeCacheSize=64m -ea
I also tried including -XX:MaxPermSize=2048m which didn't work either (believe it is not supported in Java 8 anyway).
The same code builds for another person with the same configuration. Can anyone please shed some light on what I am missing?
Details:
IntelliJ Ultimate 2016.1
Scala 2.10.3
Java 1.8.0_92
Stack Trace:
java.lang.StackOverflowError
at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:696)
at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5396)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5423)
at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5370)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5374)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$96.apply(Typers.scala:4523)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$96.apply(Typers.scala:4523)
at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:680)
at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4522)
at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4578)
at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5343)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5360)
at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:696)
at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5396)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5423)
at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5370)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5374)
at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:5472)
at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:5480)
at scala.tools.nsc.transform.Erasure$Eraser.adaptMember(Erasure.scala:642)
at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:696)
at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5396)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5423)
at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5370)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5374)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$96.apply(Typers.scala:4523)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$96.apply(Typers.scala:4523)
at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:680)
at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4522)
at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4578)