I'd like to be able to derive instances of opaque types. This would enable derivations for types we don't control and permit alternative derivations where one already exists
Currently the following code will not compile (OpaqueTypes.OpaqueType is not a class type)
object OpaqueTypes:
opaque type OpaqueType[A] = List[A]
object OpaqueType:
def derived[A]: OpaqueType[A] = Nil
import OpaqueTypes.OpaqueType
case class Boom[A](value: A) derives OpaqueType
I'd like to be able to derive instances of opaque types. This would enable derivations for types we don't control and permit alternative derivations where one already exists
Currently the following code will not compile (
OpaqueTypes.OpaqueType is not a class type
)Initial discussion here: https://github.com/lampepfl/dotty/issues/13808