如何解决scalac:Error:Assertion Failure:?

ijxebb2r  于 2022-10-07  发布在  Scala
关注(0)|答案(1)|浏览(441)

我对Scala编程非常陌生。我把密码从Git调到了Intellij。然而,我在编译时收到了下面的错误。我在Mac上安装了最新的Scala版本(3.2.0)(也安装了JDK18)。

scalac: Error: assertion failed: 
  No RuntimeVisibleAnnotations in classfile with ScalaSignature attribute: class DefaultFormats
     while compiling: /Users/usr/mainProg.scala
        during phase: globalPhase=typer, enteringPhase=namer
     library version: version 2.13.9
    compiler version: version 2.13.9
  reconstructed args: -classpath <Several Jar file locations>
  last tree to typer: Ident(net)
       tree position: line 3 of /Users/usr/mainProg.scala
            tree tpe: net.type
              symbol: final package net
   symbol definition: final package net (a ModuleSymbol)
      symbol package: <none>
       symbol owners: package net
           call site: package processing in package delta in package delta

请告诉我这里遗漏了什么。

6ju8rftf

6ju8rftf1#

https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html

  • 尝试Scala 3.1.3 for JDK 18

(尽管它是推荐用于JDK 18的最低版本,因此3.2.0应该可以工作,请在tracker报告有关Scala 3的错误)。

  • 或用于Scala 3.2.0的JDK 19。

(约RuntimeVisibleAnnotations。)

相关问题