How to resolve scalac: Error: assertion failed:?

319 Views Asked by At

I'm pretty new to Scala programming. I pulled a code from GIT into IntelliJ. However, I'm getting the below error while compiling. I have installed latest Scala version (3.2.0) on to my mac (JDK18 is also installed).

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

Please let me know what am I missing here.

1

There are 1 best solutions below

1
On

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

  • Try Scala 3.1.3 for JDK 18

(although it's the minimal version recommended for JDK 18, so 3.2.0 should work, please report about Scala 3 bugs at the tracker).

  • Or JDK 19 for Scala 3.2.0.

(About RuntimeVisibleAnnotations.)