Closed
Description
Minimized code
inline def check1[Tps <: NonEmptyTuple]: Unit =
summonInline[Mirror.Of[Tuple.Head[Tps]]]
inline def check2[Tps <: NonEmptyTuple]: Unit =
type FromType = Tuple.Head[Tps]
summonInline[Mirror.Of[FromType]]
@main def Test: Unit =
check1[Option[Int] *: EmptyTuple] // Ok
check2[Option[Int] *: EmptyTuple] // Error: FromType is widened to Any in Syntheziser
Output
13 | check2[Option[Int] *: EmptyTuple] // Error: FromType is widened to Any in Syntheziser
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|No given instance of type scala.deriving.Mirror.Of[FromType] was found. Failed to synthesize an instance of type scala.deriving.Mirror.Of[FromType]:
| * class Any is not a generic product because it is not a case class
| * class Any is not a generic sum because it is not a sealed class
|--------------------------------------------------------------------------------------------------------------------
Expectation
FromType
alias should make no difference.