Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scalac: Assertion failed while run Scalatest in IDEA

I am running a ScalaTest Suite inside Intellij IDEA, during the make phase before scala test, I run into this problem:

Error:scalac: Error: assertion failed: List(object package$DebugNode, object package$DebugNode)
      java.lang.AssertionError: assertion failed: List(object package$DebugNode, object package$DebugNode)
       at scala.reflect.internal.Symbols$Symbol.suchThat(Symbols.scala:1678)
       at scala.reflect.internal.Symbols$ClassSymbol.companionModule0(Symbols.scala:2988)
       at scala.reflect.internal.Symbols$ClassSymbol.companionModule(Symbols.scala:2991)
       at scala.tools.nsc.backend.jvm.GenASM$JPlainBuilder.genClass(GenASM.scala:1371)
       at scala.tools.nsc.backend.jvm.GenASM$AsmPhase.run(GenASM.scala:120)
       at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1583)
       at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1557)
       at scala.tools.nsc.Global$Run.compileSources(Global.scala:1553)
       at scala.tools.nsc.Global$Run.compile(Global.scala:1662)
       at xsbt.CachedCompiler0.run(CompilerInterface.scala:126)
       at xsbt.CachedCompiler0.run(CompilerInterface.scala:102)
       at xsbt.CompilerInterface.run(CompilerInterface.scala:27)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:606)
       at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:102)
       at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:48)
       at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:41)
       at org.jetbrains.jps.incremental.scala.local.IdeaIncrementalCompiler.compile(IdeaIncrementalCompiler.scala:28)
       at org.jetbrains.jps.incremental.scala.local.LocalServer.compile(LocalServer.scala:25)
       at org.jetbrains.jps.incremental.scala.remote.Main$.make(Main.scala:64)
       at org.jetbrains.jps.incremental.scala.remote.Main$.nailMain(Main.scala:22)
       at org.jetbrains.jps.incremental.scala.remote.Main.nailMain(Main.scala)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:606)
       at com.martiansoftware.nailgun.NGSession.run(NGSession.java:319)

Is it a jetbrains error due to incremental compilation? or Its related to the Test Suite I was running? Nothing information in the stack trace are related to the TestSuite/project I was test on.

like image 994
yjshen Avatar asked Oct 01 '22 14:10

yjshen


1 Answers

I think it was an error due to Interllij IDEA incremental compilation. I got the same error when I built Spark for the first time.

I went to Preferences > Scala, set Incrmental compilation by SBT incremental compiler, Name Hasing: Default, Compilation order: Mixed. Recompiled the code, everything was OK then.

like image 70
Allen Shen Avatar answered Oct 08 '22 12:10

Allen Shen