Skip to content

transform fails using oneof sealed_value with empty case #688

Discussion options

You must be logged in to vote

If it's Scala 3, then the issue is probably related to this test, and a reason it's manually edited. This code:

  // among subtypes of GeneratedSealedOneof only Empty <:< Singleton (case object),
  // it allows us to precisely that value and no other
  implicit def partialTransformerFromEmptySealedOneOfInstance[From <: scalapb.GeneratedSealedOneof with Singleton, To]
      : PartialTransformer[From, To] =
    PartialTransformer(_ => partial.Result.fromEmpty)

Scala 2 can resolve this implicit inside a macro, while Scala 3 doesn't. Scala 3 CAN resolve it outside a macro. I suspect the issue is that outside a macro it can perform check that Empty.type <:< Singleton while inside a macro it do…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@MateuszKubuszok
Comment options

Answer selected by andyczerwonka
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants