Open
Description
import scala.deriving._
case class Foo(x: Int, y: String)
def weird = {
val m = the[Mirror.ProductOf[Foo]]
type R = m.MirroredElemTypes
val mRes = the[Mirror.ProductOf[(Int, String)]]
given mt as Mirror.ProductOf[R] = mRes
}
Says:
-- [E045] Cyclic Error: ../pg/Main.scala:10:11 ---------------------------------
10 | type R = m.MirroredElemTypes
| ^
| Recursive value m needs type
longer explanation available when compiling with `-explain`
one error found
[error] Nonzero exit code returned from runner: 1
[error] (dotty-compiler / Compile / runMain) Nonzero exit code returned from runner: 1
[error] Total time: 15 s, completed Aug 15, 2019 5:24:41 PM
To make it compile:
def weird = {
val m = the[Mirror.ProductOf[Foo]]
type R = m.MirroredElemTypes
val mRes = the[Mirror.ProductOf[(Int, String)]]
// given mt as Mirror.ProductOf[R] = mRes
}