-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Compiler version
3.8.0-RC1, 3.8.1-RC1-bin-20251117-5ccea40-NIGHTLY
Works in 3.7.4
Minimized code
//> using scala 3.8.0-RC1
import scala.compiletime.{erasedValue, summonFrom}
object test {
private inline def singletons[T, Elem <: Tuple]: Seq[T] =
inline erasedValue[Elem] match {
case _: EmptyTuple => Seq.empty
case _: (h *: t) =>
summonFrom {
case _: ValueOf[`h`] => valueOf[`h` & T] +: singletons[T, t]
}
}
enum A { case A1, A2, A3 }
val _ = singletons[A, (A.A1.type, A.A2.type, A.A3.type)]
}Output
[error] ./value_of_inline.scala:15:11
[error] cannot reduce summonFrom with
[error] patterns : case given ev @ _:ValueOf[(test.A.A1 : test.A) & test.A]
[error] val _ = singletons[A, (A.A1.type, A.A2.type, A.A3.type)]
[error] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Expectation
Compiles like 3.7.4.
Slightly related to #24237