Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Is it possible to use semi-auto with recursive structures? #463

Description

@jducoeur

(Phrasing this as a question, because I don't know if this is already possible, or whether this is an enhancement suggestion.)

Given this trivial code:

sealed trait T

case class Ts(ts: List[T]) extends T

I can use full auto to derive a Diff, but it's extremely slow. I would like to be able to use semi-auto, to bring down compilation time, like this:

implicit val tdiff = Diff.derived[T]

but that fails with complaints from Magnolia, and I can't for the life of me find a variation that gets past them. I've tried spelling out various combinations of explicit derived calls, using low-priority traits and all, but each one trips up on the Magnolia macros.

(My actual use case is much, much more complex -- nested sealed traits with various recursive sub-classes -- but this seems to be the nub of the issue: I can't even figure out how to get past the starting line here.)

I really like Diffx, and would like to use it, but the compilation time for auto-derivation is problematic enough (presumably because of the complexity of the structure) that it may turn into a blocker for us. So I'm hoping that there's a way to make semi-auto work for recursive structures.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions