Skip to content

Regression in taig/enumeration-ext - crash in checkUnusedPostInlining #23494

Open
@WojciechMazur

Description

@WojciechMazur

Based on OpenCB failure found in taig/enumeration-ext - build logs

Compiler version

Last good release: 3.7.3-RC1-bin-20250626-6aaff88-NIGHTLY
First bad release: 3.7.3-RC1-bin-20250627-606268f-NIGHTLY
Bisect points to 2e4bc0a / #23438

Minimized code

//> using options -Wunused:all

import scala.deriving.Mirror

abstract class EnumerationValues[A]:
  type Out

object EnumerationValues:
  type Aux[A, B] = EnumerationValues[A] { type Out = B }

  def apply[A, B](): EnumerationValues.Aux[A, B] = new EnumerationValues[A]:
    override type Out = B

  given sum[A, B <: Tuple](using mirror: Mirror.SumOf[A] { type MirroredElemTypes = B }): EnumerationValues.Aux[A, A] = EnumerationValues[A, A]()

(mostly) self contained original code: https://github.com/taig/enumeration-ext/blob/156cbe2d11f034817f72bf0e5949fd35527e6d8e/modules/core/src/main/scala/io/taig/enumeration/ext/EnumerationValues.scala

Output

  unhandled exception while running checkUnusedPostInlining on /Users/wmazur/projects/scala/community-build3/repo/modules/core/src/main/scala/io/taig/enumeration/ext/EnumerationValues.scala

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


     while compiling: /Users/wmazur/projects/scala/community-build3/repo/modules/core/src/main/scala/io/taig/enumeration/ext/EnumerationValues.scala
        during phase: checkUnusedPostInlining
                mode: Mode(ImplicitsEnabled)
     library version: version 2.13.16
    compiler version: version 3.7.3-RC1-bin-SNAPSHOT-git-2e4bc0a
            settings: -Wunused List(all) -classpath /Users/wmazur/.ivy2/local/org.scala-lang/scala3-library_3/3.7.3-RC1-bin-SNAPSHOT/jars/scala3-library_3.jar:/Users/wmazur/.sdkman/candidates/scala/current/maven2/org/scala-lang/scala-library/2.13.16/scala-library-2.13.16.jar -d /Users/wmazur/projects/scala/community-build3/repo/modules/core/src/main/.scala-build/main_d16dcddbd9/classes/main -sourceroot /Users/wmazur/projects/scala/community-build3/repo/modules/core/src/main

dotty.tools.dotc.core.TypeError$$anon$1: invalid new prefix [T] =>>
  scala.deriving.Mirror.Sum{
    type MirroredType = T; type MirroredMonoType = T;
      type MirroredElemTypes <: Tuple
  } cannot replace (Sum.this : scala.deriving.Mirror.Sum & scala.deriving.Mirror.Sum) in type Sum.this.MirroredMonoType

Expectation

Should compile

Metadata

Metadata

Assignees

Labels

area:lintingLinting warnings enabled with -W or -Xlintitype:bugitype:crashregressionThis worked in a previous version but doesn't anymore

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions