Closed
Description
Compiler version
3.4.0
Minimized code
import scala.deriving.Mirror
case class A(x: Int, y: String)
trait SomeTrait[T]
object SomeTrait:
given [T]: SomeTrait[T] with {}
def f1[T](using p: Mirror.ProductOf[T]): Tuple.Elem[p.MirroredElemTypes, 0] = ???
def f2[T, R](f: T => R)(using SomeTrait[R]) = ???
// Scala3.3 is fine, 3.4 has compilation errors, p MirroredElemTypes type is missing and has been changed to Nothing
val x = f2(_ => f1[A])
Output
-- [E172] Type Error: ----------------------------------------------------------
13 |val x = f2(_ => f1[A])
| ^
| No given instance of type SomeTrait[
| <error Match type reduction failed since selector Nothing
| matches none of the cases
|
| case x *: xs => (0 : Int) match {
| case (0 : Int) => x
| case scala.compiletime.ops.int.S[n1] => Tuple.Elem[xs, n1]
| }>
| ] was found for parameter x$2 of method f2
1 error found
Expectation
The code is working properly