IntelliJ IDEA(最新社区版本)无法编译 dotty 编译器并出现以下错误:
scala.reflect.internal.FatalError: Could not find an output directory for
/src/contrib/dotty/scala-backend/src/compiler/scala/tools/nsc/backend/ScalaPrimitivesOps.scala
in List(
(/src/contrib/dotty/compiler/test-resources,/src/contrib/dotty/compiler/target/scala-2.12/classes),
(/src/contrib/dotty/compiler/target/scala-2.12/resource_managed/main,/src/contrib/dotty/compiler/target/scala-2.12/classes),
(/src/contrib/dotty/compiler/target/scala-2.12/src_managed/main,/src/contrib/dotty/compiler/target/scala-2.12/classes),
(/src/contrib/dotty/compiler/test,/src/contrib/dotty/compiler/target/scala-2.12/classes),
(/src/contrib/dotty/compiler/src,/src/contrib/dotty/compiler/target/scala-2.12/classes))
显然代码没有任何问题,而且 Dotty 似乎使用 sbt 编译得很好,因为该run命令有效。sbt 项目是否需要做一些特别的事情才能使 IDEA 使用 sbt 进行编译?这会导致这个错误吗?否则,这个错误是什么意思?
重现
从以前的安装中删除任何设置后,使用新安装的 IntelliJ IDEA。
下载存储库
git clone --recursive https://github.com/lampepfl/dotty确保
sbt已安装最新版本。sbt managedSources从项目的根目录运行。使用Oracle JDK 1.8
Import project from external model的类型设置导入 IntelliJ 。sbt否则保持默认值。右键单击项目资源管理器中的项目并选择
Load/Unload Modules.... 卸载除dotty、dotty-compiler和之外dotty-library的所有模块dotty-interfaces。( http://dotty.epfl.ch/docs/contributing/intellij-idea.html中列出的模块)在项目资源管理器中,单击
compiler。从Build菜单中单击Build Module 'dotty-compiler'。
什么不能解决它
它不能解决任何事情File=> Invalidate Caches/Restart。
它没有修复任何东西来保持所有模块的加载。
