You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
Found this issue while trying out circe-derivation 0.8.0-M2:
importio.circe.{Decoder, Encoder}
importio.circe.derivation._traitTypeclass[T]
// notice additional context bound herecaseclassTest1[T:Typeclass](v: T)
caseclassTest2[T](v: T)
objectCirceDerivation {
// we have to pass the bound here.implicitdefencT1[T:Typeclass:Encoder]:Encoder[Test1[T]] = deriveEncoder[Test1[T]]
implicitdefdecT1[T:Typeclass:Decoder]:Decoder[Test1[T]] = deriveDecoder[Test1[T]]
implicitdefencT2[T:Encoder]:Encoder[Test2[T]] = deriveEncoder[Test2[T]]
implicitdefdecT2[T:Decoder]:Decoder[Test2[T]] = deriveDecoder[Test2[T]]
}
For Test2 all good.
For Test1 derivation fails with this (for both encoder and decoder):
exception during macro expansion:
[error] scala.ScalaReflectionException: value evidence$1 is not a method
[error] at scala.reflect.api.Symbols$SymbolApi.asMethod(Symbols.scala:228)
[error] at scala.reflect.api.Symbols$SymbolApi.asMethod$(Symbols.scala:222)
[error] at scala.reflect.internal.Symbols$SymbolContextApiImpl.asMethod(Symbols.scala:88)
[error] at io.circe.derivation.DerivationMacros$$anonfun$membersFromPrimaryConstr$1.$anonfun$applyOrElse$1(DerivationMacros.scala:45)
[error] at scala.collection.immutable.List.map(List.scala:287)
[error] at io.circe.derivation.DerivationMacros$$anonfun$membersFromPrimaryConstr$1.applyOrElse(DerivationMacros.scala:44)
[error] at io.circe.derivation.DerivationMacros$$anonfun$membersFromPrimaryConstr$1.applyOrElse(DerivationMacros.scala:43)
[error] at scala.collection.TraversableOnce.collectFirst(TraversableOnce.scala:145)
[error] at scala.collection.TraversableOnce.collectFirst$(TraversableOnce.scala:132)
[error] at scala.reflect.internal.Scopes$Scope.collectFirst(Scopes.scala:51)
[error] at io.circe.derivation.DerivationMacros.membersFromPrimaryConstr(DerivationMacros.scala:43)
[error] at io.circe.derivation.DerivationMacros.productRepr(DerivationMacros.scala:52)
[error] at io.circe.derivation.DerivationMacros.materializeEncoderImpl(DerivationMacros.scala:221)
[error] at io.circe.derivation.DerivationMacros.materializeEncoder(DerivationMacros.scala:87)
[error] implicit def encT1[T: Typeclass : Encoder]: Encoder[Test1[T]] = deriveEncoder[Test1[T]]
The text was updated successfully, but these errors were encountered:
@travisbrown This issue is still alive in 0.9.0-M3, right? For the time being I have to keep a semiauto usage because the class in question has a [T : ClassTag] bound.
Hi!
Found this issue while trying out circe-derivation 0.8.0-M2:
For Test2 all good.
For Test1 derivation fails with this (for both encoder and decoder):
The text was updated successfully, but these errors were encountered: