magnolia icon indicating copy to clipboard operation
magnolia copied to clipboard

"Internal error: unable to find the outer accessor symbol of ..." when deriving instance for a nested type

Open notxcain opened this issue 2 years ago • 3 comments

Version: 1.12

Reproducer: https://scastie.scala-lang.org/lZwX8BQSThWjL8sEAnSPnw

notxcain avatar Jan 14 '23 07:01 notxcain

Seems to be a problem with a combination of classes defined in traits + default field values

adamw avatar Jan 14 '23 10:01 adamw

Yes, but it works if you put derivation inside the companion.

trait X {
  case class F(i: Int = 5)
  object F {
    implicit def tc: TC[F] = TC.derive[F]
  }
}

notxcain avatar Jan 14 '23 14:01 notxcain