我正在使用IntelliJ IDEA 13.1.6 CE
我习惯于在终止中使用sbt编译我的应用程序(有效)。我想使用IDEA的调试功能,而不必忽视假阴性错误。
Project设置为使用JDK 1.8.0_25 ant项目语言级别8.0编译scala 2.10.4(这也适用于语言级别7.0)。
这是我在IDEA中“制作模块”时的堆栈跟踪。它在特定的Twirl * .template.scala文件中失败,但它也在其他文件上失败,例如生成的target/scala-2.10/src_managed/main/controllers/routes.java
文件
== Expanded type of tree ==
ConstantType(value = Constant(play.twirl.api.Html))
uncaught exception during compilation: java.lang.AssertionError
Error:scalac: Error: assertion failed: List(object package$Stopwatch, object package$Stopwatch)
java.lang.AssertionError: assertion failed: List(object package$Stopwatch, object package$Stopwatch)
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:26)
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)
这个要点具有模板的完整AST:https://gist.github.com/joshm1/1615d75925dcdb3bc23e
答案 0 :(得分:1)
我能够通过从命令行运行sbt test:compile
然后在IntelliJ中运行Make Module来实现此功能。只是运行sbt compile
没有帮助。
以下页面与我的问题有关:
Twirl显然无法在IDEA CE中编译 - https://devnet.jetbrains.com/message/5528393#5528393
包含类和随播广告的包对象的编译器崩溃 https://issues.scala-lang.org/browse/SI-5954