Closed
Description
Any Mirror for a value alias to a case object will crash when calling the fromProduct
method, this is because it tries to access the constructor. (i.e. a singleton mirror is not synthesised, but instead a standard product mirror).
Compiler version
3.0.0 - 3.1.2
Minimized code
import scala.deriving.Mirror
@main def Test =
println(summon[Mirror.Of[Nil.type]].fromProduct(EmptyTuple))
Output
Exception in thread "main" java.lang.IllegalAccessError: tried to access method scala.collection.immutable.Nil$.<init>()V from class App$package$$anon$1
at App$package$$anon$1.fromProduct(App.scala:4)
at App$package$$anon$1.fromProduct(App.scala:4)
at App$package$.Test(App.scala:4)
at Test.main(App.scala:3)
Expectation
I expect to see List()
printed