scala / scala3

The Scala 3 compiler, also known as Dotty.
https://dotty.epfl.ch
Apache License 2.0
5.88k stars 1.06k forks source link

java exception during first attempt to do REPL completion by TAB in sbt console on Scala 3.4.1 #20421

Open bjornregnell opened 6 months ago

bjornregnell commented 6 months ago

Compiler version

Use Scala 3.4.1 and any sbt of version 1.9.8, 1.9.9, 1.10.0.

Minimized code

Start the console and type Seq. and press TAB for completion.

image

Output

exception caught when loading class module-info: java.lang.AssertionError: assertion failed: attempt to parse java.lang.Object from classfile

Expectation

no exception

bjornregnell commented 6 months ago

Same as this issue cross-posted here on request by @smarter : https://github.com/sbt/sbt/issues/7560

As the root cause might be here and not in sbt.

smarter commented 6 months ago

module-info.class is a magic JPMS thing generated from the also magic module-info.java that doesn't behave like a regular classfile. We should not even try to load it because - is not valid in a classfile name, so it should be skipped over.

bjornregnell commented 6 months ago

So scala-cli has some smarter loading logic here? Or why does 3.4.1 work when REPL from scala-cli?

smarter commented 6 months ago

It has to do with how classpaths are setup but I don't know where the difference comes from. Running with -Ylog-classpath might give more information.

bjornregnell commented 6 months ago
bjornr@bjornix:~/tmp/console-bug
$ cat build.sbt 
scalaVersion := "3.4.1"
scalacOptions += "-Ylog-classpath"
bjornr@bjornix:~/tmp/console-bug
$ sbt console
[info] welcome to sbt 1.9.9 (Eclipse Adoptium Java 17.0.6)
[info] loading project definition from /home/bjornr/tmp/console-bug/project
[info] loading settings for project console-bug from build.sbt ...
[info] set current project to console-bug (in build file:/home/bjornr/tmp/console-bug/)
Classpath built from (Setting(-bootclasspath,Override location of bootstrap class files.,,,None,,List(--boot-class-path),List(),false,None) Setting(-classpath,Specify where to find user class files.,.,,None,,List(-cp, --class-path),List(),false,None) Setting(-Ylog-classpath,Output information about what classpath is being applied.,false,,None,,List(),List(),false,None) Setting(-Ycook-docs,Cook the documentation (type check `@usecase`, etc.),false,,None,,List(-Ycook-comments),List(),false,None) Setting(-Yread-docs,Read documentation from tasty.,false,,None,,List(),List(),false,None))
Defaults: object Defaults {
  scalaHome            = 
  javaBootClassPath    = 
  scalaLibDirFound     = None
  scalaLibFound        = 
  scalaBootClassPath   = 
  scalaPluginPath      = misc/scala-devel/plugins
}
Calculated: object Calculated {
  scalaHome            = 
  javaBootClassPath    = 
  javaExtDirs          = 
  javaUserClassPath    = 
  useJavaClassPath     = false
  scalaBootClassPath   = 
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.4.1/scala3-library_3-3.4.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar
  scalaExtDirs         = /home/bjornr/.sbt/1.0/java9-rt-ext-eclipse_adoptium_17_0_6
  userClassPath        = 
/home/bjornr/tmp/console-bug/target/scala-3.4.1/classes
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/3.4.1/scala3-compiler_3-3.4.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-interfaces/3.4.1/scala3-interfaces-3.4.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/tasty-core_3/3.4.1/tasty-core_3-3.4.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-asm/9.6.0-scala-1/scala-asm-9.6.0-scala-1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.9.6/compiler-interface-1.9.6.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-reader/3.19.0/jline-reader-3.19.0.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal/3.19.0/jline-terminal-3.19.0.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal-jna/3.19.0/jline-terminal-jna-3.19.0.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-interface/1.9.8/util-interface-1.9.8.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna/5.3.1/jna-5.3.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scaladoc_3/3.4.1/scaladoc_3-3.4.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-tasty-inspector_3/3.4.1/scala3-tasty-inspector_3-3.4.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark/0.62.2/flexmark-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-ast/0.62.2/flexmark-util-ast-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-data/0.62.2/flexmark-util-data-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-html/0.62.2/flexmark-util-html-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-anchorlink/0.62.2/flexmark-ext-anchorlink-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-autolink/0.62.2/flexmark-ext-autolink-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-emoji/0.62.2/flexmark-ext-emoji-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-gfm-strikethrough/0.62.2/flexmark-ext-gfm-strikethrough-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-gfm-tasklist/0.62.2/flexmark-ext-gfm-tasklist-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-wikilink/0.62.2/flexmark-ext-wikilink-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-tables/0.62.2/flexmark-ext-tables-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-yaml-front-matter/0.62.2/flexmark-ext-yaml-front-matter-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/nl/big-o/liqp/0.8.2/liqp-0.8.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jsoup/jsoup/1.17.2/jsoup-1.17.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/dataformat/jackson-dataformat-yaml/2.15.1/jackson-dataformat-yaml-2.15.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-builder/0.62.2/flexmark-util-builder-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-collection/0.62.2/flexmark-util-collection-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-dependency/0.62.2/flexmark-util-dependency-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-format/0.62.2/flexmark-util-format-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-misc/0.62.2/flexmark-util-misc-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-sequence/0.62.2/flexmark-util-sequence-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-visitor/0.62.2/flexmark-util-visitor-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jetbrains/annotations/15.0/annotations-15.0.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util/0.62.2/flexmark-util-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/nibor/autolink/autolink/0.6.0/autolink-0.6.0.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-jira-converter/0.62.2/flexmark-jira-converter-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/antlr/antlr4-runtime/4.7.2/antlr4-runtime-4.7.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.15.1/jackson-annotations-2.15.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.15.1/jackson-core-2.15.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.15.1/jackson-databind-2.15.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.12.1/jackson-datatype-jsr310-2.12.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/ua/co/k/strftime4j/1.0.5/strftime4j-1.0.5.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/yaml/snakeyaml/2.0/snakeyaml-2.0.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-options/0.62.2/flexmark-util-options-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-ins/0.62.2/flexmark-ext-ins-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-superscript/0.62.2/flexmark-ext-superscript-0.62.2.jar
  sourcePath           = 
}
After java boot/extdirs classpath has 51 entries:
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.4.1/scala3-library_3-3.4.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar,None)
  ZipArchiveClassPath(/home/bjornr/.sbt/1.0/java9-rt-ext-eclipse_adoptium_17_0_6/rt.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/3.4.1/scala3-compiler_3-3.4.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-interfaces/3.4.1/scala3-interfaces-3.4.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/tasty-core_3/3.4.1/tasty-core_3-3.4.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-asm/9.6.0-scala-1/scala-asm-9.6.0-scala-1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.9.6/compiler-interface-1.9.6.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-reader/3.19.0/jline-reader-3.19.0.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal/3.19.0/jline-terminal-3.19.0.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal-jna/3.19.0/jline-terminal-jna-3.19.0.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-interface/1.9.8/util-interface-1.9.8.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna/5.3.1/jna-5.3.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scaladoc_3/3.4.1/scaladoc_3-3.4.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-tasty-inspector_3/3.4.1/scala3-tasty-inspector_3-3.4.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark/0.62.2/flexmark-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-ast/0.62.2/flexmark-util-ast-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-data/0.62.2/flexmark-util-data-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-html/0.62.2/flexmark-util-html-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-anchorlink/0.62.2/flexmark-ext-anchorlink-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-autolink/0.62.2/flexmark-ext-autolink-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-emoji/0.62.2/flexmark-ext-emoji-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-gfm-strikethrough/0.62.2/flexmark-ext-gfm-strikethrough-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-gfm-tasklist/0.62.2/flexmark-ext-gfm-tasklist-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-wikilink/0.62.2/flexmark-ext-wikilink-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-tables/0.62.2/flexmark-ext-tables-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-yaml-front-matter/0.62.2/flexmark-ext-yaml-front-matter-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/nl/big-o/liqp/0.8.2/liqp-0.8.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jsoup/jsoup/1.17.2/jsoup-1.17.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/dataformat/jackson-dataformat-yaml/2.15.1/jackson-dataformat-yaml-2.15.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-builder/0.62.2/flexmark-util-builder-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-collection/0.62.2/flexmark-util-collection-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-dependency/0.62.2/flexmark-util-dependency-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-format/0.62.2/flexmark-util-format-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-misc/0.62.2/flexmark-util-misc-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-sequence/0.62.2/flexmark-util-sequence-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-visitor/0.62.2/flexmark-util-visitor-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jetbrains/annotations/15.0/annotations-15.0.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util/0.62.2/flexmark-util-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/nibor/autolink/autolink/0.6.0/autolink-0.6.0.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-jira-converter/0.62.2/flexmark-jira-converter-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/antlr/antlr4-runtime/4.7.2/antlr4-runtime-4.7.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.15.1/jackson-annotations-2.15.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.15.1/jackson-core-2.15.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.15.1/jackson-databind-2.15.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.12.1/jackson-datatype-jsr310-2.12.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/ua/co/k/strftime4j/1.0.5/strftime4j-1.0.5.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/yaml/snakeyaml/2.0/snakeyaml-2.0.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-options/0.62.2/flexmark-util-options-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-ins/0.62.2/flexmark-ext-ins-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-superscript/0.62.2/flexmark-ext-superscript-0.62.2.jar,None)
Welcome to Scala 3.4.1 (17.0.6, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.

scala> Seq.Classpath built from (Setting(-bootclasspath,Override location of bootstrap class files.,,,None,,List(--boot-class-path),List(),false,None) Setting(-classpath,Specify where to find user class files.,.,,None,,List(-cp, --class-path),List(),false,None) Setting(-d,Destination for generated classfiles.,.,directory|jar,None,,List(),List(),false,None) Setting(-Ylog-classpath,Output information about what classpath is being applied.,false,,None,,List(),List(),false,None) Setting(-Ycook-docs,Cook the documentation (type check `@usecase`, etc.),false,,None,,List(-Ycook-comments),List(),false,None) Setting(-Yread-docs,Read documentation from tasty.,false,,None,,List(),List(),false,None))
Defaults: object Defaults {
  scalaHome            = 
  javaBootClassPath    = 
  scalaLibDirFound     = None
  scalaLibFound        = 
  scalaBootClassPath   = 
  scalaPluginPath      = misc/scala-devel/plugins
}
Calculated: object Calculated {
  scalaHome            = 
  javaBootClassPath    = 
  javaExtDirs          = 
  javaUserClassPath    = 
  useJavaClassPath     = false
  scalaBootClassPath   = 
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.4.1/scala3-library_3-3.4.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar
  scalaExtDirs         = /home/bjornr/.sbt/1.0/java9-rt-ext-eclipse_adoptium_17_0_6
  userClassPath        = 
/home/bjornr/tmp/console-bug/target/scala-3.4.1/classes
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/3.4.1/scala3-compiler_3-3.4.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-interfaces/3.4.1/scala3-interfaces-3.4.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/tasty-core_3/3.4.1/tasty-core_3-3.4.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-asm/9.6.0-scala-1/scala-asm-9.6.0-scala-1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.9.6/compiler-interface-1.9.6.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-reader/3.19.0/jline-reader-3.19.0.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal/3.19.0/jline-terminal-3.19.0.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal-jna/3.19.0/jline-terminal-jna-3.19.0.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-interface/1.9.8/util-interface-1.9.8.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna/5.3.1/jna-5.3.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scaladoc_3/3.4.1/scaladoc_3-3.4.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-tasty-inspector_3/3.4.1/scala3-tasty-inspector_3-3.4.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark/0.62.2/flexmark-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-ast/0.62.2/flexmark-util-ast-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-data/0.62.2/flexmark-util-data-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-html/0.62.2/flexmark-util-html-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-anchorlink/0.62.2/flexmark-ext-anchorlink-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-autolink/0.62.2/flexmark-ext-autolink-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-emoji/0.62.2/flexmark-ext-emoji-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-gfm-strikethrough/0.62.2/flexmark-ext-gfm-strikethrough-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-gfm-tasklist/0.62.2/flexmark-ext-gfm-tasklist-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-wikilink/0.62.2/flexmark-ext-wikilink-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-tables/0.62.2/flexmark-ext-tables-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-yaml-front-matter/0.62.2/flexmark-ext-yaml-front-matter-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/nl/big-o/liqp/0.8.2/liqp-0.8.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jsoup/jsoup/1.17.2/jsoup-1.17.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/dataformat/jackson-dataformat-yaml/2.15.1/jackson-dataformat-yaml-2.15.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-builder/0.62.2/flexmark-util-builder-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-collection/0.62.2/flexmark-util-collection-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-dependency/0.62.2/flexmark-util-dependency-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-format/0.62.2/flexmark-util-format-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-misc/0.62.2/flexmark-util-misc-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-sequence/0.62.2/flexmark-util-sequence-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-visitor/0.62.2/flexmark-util-visitor-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jetbrains/annotations/15.0/annotations-15.0.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util/0.62.2/flexmark-util-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/nibor/autolink/autolink/0.6.0/autolink-0.6.0.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-jira-converter/0.62.2/flexmark-jira-converter-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/antlr/antlr4-runtime/4.7.2/antlr4-runtime-4.7.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.15.1/jackson-annotations-2.15.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.15.1/jackson-core-2.15.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.15.1/jackson-databind-2.15.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.12.1/jackson-datatype-jsr310-2.12.1.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/ua/co/k/strftime4j/1.0.5/strftime4j-1.0.5.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/yaml/snakeyaml/2.0/snakeyaml-2.0.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-options/0.62.2/flexmark-util-options-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-ins/0.62.2/flexmark-ext-ins-0.62.2.jar
/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-superscript/0.62.2/flexmark-ext-superscript-0.62.2.jar
  sourcePath           = 
}
After java boot/extdirs classpath has 51 entries:
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.4.1/scala3-library_3-3.4.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar,None)
  ZipArchiveClassPath(/home/bjornr/.sbt/1.0/java9-rt-ext-eclipse_adoptium_17_0_6/rt.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/3.4.1/scala3-compiler_3-3.4.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-interfaces/3.4.1/scala3-interfaces-3.4.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/tasty-core_3/3.4.1/tasty-core_3-3.4.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-asm/9.6.0-scala-1/scala-asm-9.6.0-scala-1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.9.6/compiler-interface-1.9.6.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-reader/3.19.0/jline-reader-3.19.0.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal/3.19.0/jline-terminal-3.19.0.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jline/jline-terminal-jna/3.19.0/jline-terminal-jna-3.19.0.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-interface/1.9.8/util-interface-1.9.8.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna/5.3.1/jna-5.3.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scaladoc_3/3.4.1/scaladoc_3-3.4.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-tasty-inspector_3/3.4.1/scala3-tasty-inspector_3-3.4.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark/0.62.2/flexmark-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-ast/0.62.2/flexmark-util-ast-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-data/0.62.2/flexmark-util-data-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-html/0.62.2/flexmark-util-html-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-anchorlink/0.62.2/flexmark-ext-anchorlink-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-autolink/0.62.2/flexmark-ext-autolink-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-emoji/0.62.2/flexmark-ext-emoji-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-gfm-strikethrough/0.62.2/flexmark-ext-gfm-strikethrough-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-gfm-tasklist/0.62.2/flexmark-ext-gfm-tasklist-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-wikilink/0.62.2/flexmark-ext-wikilink-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-tables/0.62.2/flexmark-ext-tables-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-yaml-front-matter/0.62.2/flexmark-ext-yaml-front-matter-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/nl/big-o/liqp/0.8.2/liqp-0.8.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jsoup/jsoup/1.17.2/jsoup-1.17.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/dataformat/jackson-dataformat-yaml/2.15.1/jackson-dataformat-yaml-2.15.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-builder/0.62.2/flexmark-util-builder-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-collection/0.62.2/flexmark-util-collection-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-dependency/0.62.2/flexmark-util-dependency-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-format/0.62.2/flexmark-util-format-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-misc/0.62.2/flexmark-util-misc-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-sequence/0.62.2/flexmark-util-sequence-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-visitor/0.62.2/flexmark-util-visitor-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jetbrains/annotations/15.0/annotations-15.0.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util/0.62.2/flexmark-util-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/nibor/autolink/autolink/0.6.0/autolink-0.6.0.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-jira-converter/0.62.2/flexmark-jira-converter-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/antlr/antlr4-runtime/4.7.2/antlr4-runtime-4.7.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.15.1/jackson-annotations-2.15.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.15.1/jackson-core-2.15.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.15.1/jackson-databind-2.15.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.12.1/jackson-datatype-jsr310-2.12.1.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/ua/co/k/strftime4j/1.0.5/strftime4j-1.0.5.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/org/yaml/snakeyaml/2.0/snakeyaml-2.0.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-util-options/0.62.2/flexmark-util-options-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-ins/0.62.2/flexmark-ext-ins-0.62.2.jar,None)
  ZipArchiveClassPath(/home/bjornr/.cache/coursier/v1/https/repo1.maven.org/maven2/com/vladsch/flexmark/flexmark-ext-superscript/0.62.2/flexmark-ext-superscript-0.62.2.jar,None)
exception caught when loading class module-info: java.lang.AssertionError: assertion failed: attempt to parse java.lang.Object from classfile
bjornregnell commented 6 months ago

Running with -Ylog-classpath might give more information.

Indeed more information... Sorry for spamming many lines here.

bjornregnell commented 6 months ago

@smarter can you reproduce it on your machine? (Just type Seq. in sbt console and press TAB and it should show the exception)

SethTisue commented 5 months ago

@bishabosha is it possible this has to do with the pipelining changes somehow...? didn't "module-info" come up in that context not long ago?

smarter commented 5 months ago

@smarter can you reproduce it on your machine?

Yes.

bjornregnell commented 5 months ago

The only workaround I have found so far: Revert to Scala version 3.3.3

It does not seem to help to revert to older sbt such as 1.9.7, because with scala 3.4.2 the repl craches jline with java.lang.NoSuchMethodError: 'org.jline.utils.AttributedString org.jline.utils.AttributedString.fromAnsi(java.lang.String, java.util.List, java.lang.String, java.lang.String)' when sbt console using 3.4.2 + older sbt (tested with OpenJDK 17).

mpollmeier commented 5 months ago

Thanks for the investigation so far! The information is all here, but just as a brief summary for users who found this issue and are just looking for a quick&dirty workaround: You can either revert to Scala 3.3.3 or get rid of all module-info.class files from your classpath. Depending on how you package your app, you could post-process it with something equivalent to zip -d foo.jar module-info.class.

A minified reproduction of the issue without sbt:

git clone https://github.com/mpollmeier/scala-repl-pp.git
cd scala-repl-pp
sbt stage
./srp --dep org.projectlombok:lombok:1.18.32

scala> Seq.<TAB>

n.b.1) scala-repl-pp wraps the stock repl n.b.2) lombok is simply one example for a jar that contains a module-info.class

Looking ahead: +1 for @smarter's comment to simply ignore anything from module-info.class

mpollmeier commented 3 months ago

In case anyone else is in dire need for a hacky workaround: in joern's sbt build we post-process the staged dependencies and remove all /module-info.class from the jars: https://github.com/joernio/joern/blob/bd38a15ada2f09098265c5e4ca44ba9959f808af/joern-cli/build.sbt#L134-L154