Skip to content

Compiler crashes when it encounters Java classfile API #13176

@noresttherein

Description

@noresttherein

Related to #13175

Scala version: 2.13.16

import java.lang.classfile.ClassModel
import java.lang.classfile.{ClassFile, CodeTransform}

object Transform {
	val file = ClassFile.of()
	val model = file.parse(new Array[Byte](0))
}

Problem

scala: 
  unrecoverable error
     while compiling: C:\Users\turin\porn\test\src\main\scala\Transform.scala
        during phase: globalPhase=erasure, enteringPhase=posterasure
     library version: version 2.13.16
    compiler version: version 2.13.16
  reconstructed args: -feature -Wconf:cat=feature:w -Wconf:cat=deprecation&msg=foldRight:silent -Wconf:cat=deprecation&msg=foldLeft:silent -Wconf:cat=deprecation:w -Wconf:cat=feature:w -Wconf:cat=deprecation:ws -Wconf:cat=feature:ws -Wconf:cat=optimizer:ws -Wunused:patvars -Wunused:privates -Wunused:locals -classpath C:\Users\turin\porn\test\target\scala-2.13\classes;C:\Users\turin\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-lang\scala-library\2.13.16\scala-library-2.13.16.jar;C:\Users\turin\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\aspectj\aspectjrt\1.8.10\aspectjrt-1.8.10.jar;C:\Users\turin\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-lang\scala-compiler\2.13.16\scala-compiler-2.13.16.jar;C:\Users\turin\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-lang\scala-reflect\2.13.16\scala-reflect-2.13.16.jar;C:\Users\turin\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\aspectj\aspectjweaver\1.9.25.1\aspectjweaver-1.9.25.1.jar;C:\Users\turin\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\net\bytebuddy\byte-buddy\1.18.8\byte-buddy-1.18.8.jar;C:\Users\turin\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\io\github\java-diff-utils\java-diff-utils\4.15\java-diff-utils-4.15.jar;C:\Users\turin\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\jline\jline\3.27.1\jline-3.27.1-jdk8.jar -language:existentials -language:higherKinds -language:implicitConversions -language:reflectiveCalls

  last tree to typer: Ident(<empty>)
       tree position: line 1 of C:\Users\turin\porn\test\src\main\scala\VarOps.scala
            tree tpe: <empty>.type
              symbol: final package <empty>
   symbol definition: final package <empty> (a EmptyPackage)
      symbol package: <none>
       symbol owners: package <empty>
           call site: object Transform in package <empty>

== Source file context for tree position ==


The position shows an unrelated file VarOps.scala with all contents commented out, so is unhelpful here.

Metadata

Metadata

Assignees

Labels

fixed in Scala 3This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions