The class definition looks like this:
abstract class EntityWithIdHelper[E <: { def id: Int }] {
def idLens: Lens[E, Int] = GenLens[E](_.id)
...
How do you avoid this problem - Cannot find method id in E? Is there any workaround?
The class definition looks like this:
abstract class EntityWithIdHelper[E <: { def id: Int }] {
def idLens: Lens[E, Int] = GenLens[E](_.id)
...
How do you avoid this problem - Cannot find method id in E? Is there any workaround?
Copyright © 2021 Jogjafile Inc.
You cannot create a
Lensforidbecause aLensrequires a getter and a setter and here you only have a getter.Also if you want to use
GenLens[E],Ehas to be a case class.