Skip to content

"bad constant pool tag 17" when using a library compiled using Java 21 #12936

Closed
@SethTisue

Description

@SethTisue

this is the Scala 2 equivalent of scala/scala3#19527, reported against Scala 3 by @adamw yesterday

the original report has some information about what kind of bytecode is involved — it’s switch on certain types, e.g. Java enums

Scala 2 reproducer:

//> using scala 2.nightly
//> using dep com.softwaremill.jox:core:0.0.5

import com.softwaremill.jox.Channel

object Test {
  def main(argv: Array[String]): Unit =
    new Channel(0)
}

result:

Error: 
  bad constant pool tag 17 at byte 10172
     while compiling: /Users/tisue/tmp/dotty-19527/S.scala
        during phase: globalPhase=typer, enteringPhase=namer
    ...
	at scala.tools.nsc.symtab.classfile.ClassfileParser$ConstantPool.errorBadTag(ClassfileParser.scala:411)
	at scala.tools.nsc.symtab.classfile.ClassfileParser$ConstantPool.<init>(ClassfileParser.scala:230)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.$anonfun$parse$2(ClassfileParser.scala:173)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.$anonfun$parse$1(ClassfileParser.scala:159)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.parse(ClassfileParser.scala:142)
	at scala.tools.nsc.symtab.SymbolLoaders$ClassfileLoader.doComplete(SymbolLoaders.scala:342)
	at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.$anonfun$complete$2(SymbolLoaders.scala:249)
	...

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions