In the recent discussion about scala 3 migration, the topic of dropped general type projections was brought up.
I understand the general reason for unsoundness, but we have a working and generic enough alternative through match types.
trait Request {
type Result
}
object Request {
type Aux[T] = Request { type Result = T }
type Result[T <: Request] = T match {
case Aux[s] => s
}
}
def foo[T <: Request]: Request.Result[T]
I’m wondering if we could make this pattern more streamlined? Could we use the same logic behind #
syntax for type projection? Hence support it again for any type?