Skip to content

Conversation

MartinHH
Copy link

Leverage summonAll to avoid recursive inlining as proposed in #574

So far, this is just a proof of concept.

Various tests are still failing - most of them are related to error messages of compilation errors not being as expected, but
one ("derive instances for types with refined types if implicit provided") seems a bit more serious (compilation fails when it shouldn't).

Leverage summonAll instead of recursion.
@MartinHH
Copy link
Author

MartinHH commented Feb 16, 2025

"derive instances for types with refined types if implicit provided"

Turns out that one doesn't fail when changing the project's scala version to 3.4.0 (and the unexpected error messages from the other failing tests are also much closer to the expected ones).

Maybe it would make sense to postpone this change until the next LTS version (3.7.0) is out and Magnolia is migrated to that (?).

} { params => product.fromProduct(Tuple.fromArray(params)) }
}

private trait ParamFactory[TC[_], P]:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where one would need to add an @implicitNotFound annotation in order to fix the failing tests related to (compilation) error messages.

Something along the lines of:

@implicitNotFound("No given instance of type ${TC} (for type ${P}) was found")

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant