Skip to content

-from-tasty compilation crashes on code that compiles normal way #20498

Closed
@Florian3k

Description

@Florian3k

Compiler version

3.4.2

Minimized code

3 files
ops.scala:

package demo.util
trait Ops:
  final implicit class Ops[A](private val self: A):
    def tap(): Unit = ()

package.scala:

package demo
package object util extends Ops

impl.scala:

package demo.debug
import demo.util._
class Impl:
  "".tap()

Standard compilation (scalac *.scala) succeeds producing the following output:

demo
├── debug
│  ├── Impl.class
│  └── Impl.tasty
└── util
   ├── Ops$Ops.class
   ├── Ops.class
   ├── Ops.tasty
   ├── package$.class
   ├── package.class
   └── package.tasty

-from-tasty compilation (scalac -from-tasty demo/*/*.tasty) fails with:


  exception occurred while readTasty class file demo.debug.Impl

  An unhandled exception was thrown in the compiler.
  Please file a crash report here:
  https://github.com/scala/scala3/issues/new/choose
  For non-enriched exceptions, compile with -Yno-enrich-error-messages.

     while compiling: class file demo.debug.Impl
        during phase: readTasty
                mode: Mode(ImplicitsEnabled,ReadPositions)
     library version: version 2.13.12
    compiler version: version 3.4.2
            settings: -classpath :. -from-tasty true

cannot resolve reference to type demo.util.package.type.Ops
the classfile defining the type might be missing from the classpath

Note

changing implicit class name to something else (e.g. Ops2) makes the crash go away

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions