I would like to have exports working with opaque tyeps in Scala 3:
opaque type BigNumber = BigInt
object BigNumber:
def apply(s: String): BigNumber = BigInt(s)
extension (cv: BigNumber)
export cv.(unary_- as myUnary}
val c = BigNumber("7")
c.myUnary // I wish to have -7 as BigNumber
It would be very handy to work that way. But it doesn't work :/
What is the walkaround?
Michał Pałka has shown me this working hack:
It's even in the official documentation.
DRAWBACK: type is not preserved :(