Shapeless has an optional class derivation mechanism that allows you to determine class types and get automatic output for any class.
To use the derivation mechanism as a class user, you must use the following syntax
import MyTypeClass.auto._
as far as I understand, this is equivalent
import MyTypeClass.auto.derive
The problem arises when you try to use several types of types, similar to those within the same area. It seems that the Scala compiler only considers the last definition of output, although there are two versions of the function that are “overloaded” by their implicit arguments.
There are several ways I can fix this. Instead of listing them here, I will mark them as answers that you can vote to confirm sanity, as well as suggest a better solution.
source
share