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
traitEncoder[T]
objectEncoder:defderived[T](using scala.deriving.Mirror.Of[T]):Encoder[T] =???caseobjectBarenumBarderivesEncoder:caseA, B
summon[Encoder[Bar]]
Output
[error] java.lang.ClassCastException:classexample.Bar$ cannot be cast to classscala.deriving.Mirror$Sum (example.Bar$ is in unnamed module of loader sbt.internal.LayeredClassLoader@3e209f63; scala.deriving.Mirror$Sum is in unnamed module of loader sbt.internal.ScalaLibraryClassLoader@69bc5ee3)
[error] at example.Bar$.derived$Encoder(Hello.scala:8)
[error] at example.Hello$package$.main(Hello.scala:12)
[error] at example.main.main(Hello.scala:11)
[error] at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
[error] at java.base/java.lang.reflect.Method.invoke(Method.java:577)
Expectation
Code should run.
Remarks
If object Bar is not a case object the code runs without any problem.
The text was updated successfully, but these errors were encountered:
Compiler version
3.0.0 onwards
Minimized code
Output
Expectation
Code should run.
Remarks
If object Bar is not a case object the code runs without any problem.
The text was updated successfully, but these errors were encountered: