-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inversion failure for TEnumCodec #166
Comments
So, the issue here is that when doing reflection on the TEnum, we can't see that the reflection will fail. The right way to solve this is probably with a macro: the macro should look for the method at compile time so the error is seen (or actually, even better, we look for the correct method). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Scrooge generated ThriftEnum does extend the apache TEnum, e.g. https://github.com/twitter/scrooge/blob/master/scrooge-core/src/main/scala/com/twitter/scrooge/ThriftEnum.scala#L5
sealed trait EngagementType extends ThriftEnum with Serializable
But the com.twitter.bijection.thrift.TEnumCodec.toBinary[T <: TEnum] throws when used with scrooge TEnum.
Maybe the solution is to simply create a com.twitter.bijection.scrooge.ThriftEnumCodec, though it would be nice to catch this at compile time.
The text was updated successfully, but these errors were encountered: