Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@guizmaii
Copy link
Member

@guizmaii guizmaii commented Mar 24, 2025

Implementation inspired by Caliban
See:

Usage example:

type StringOrInt = String | Int
given DeriveGen[StringOrInt] = DeriveGen.unionType[StringOrInt]
lazy val anyStringOrInt: Gen[Any, StringOrInt] = DeriveGen[UnionType]

@guizmaii guizmaii self-assigned this Mar 24, 2025
@guizmaii guizmaii changed the title Implement union types Gen instances derivation Implement union types Gen instance derivation Mar 24, 2025
@guizmaii guizmaii marked this pull request as draft March 24, 2025 05:06
@guizmaii guizmaii marked this pull request as ready for review March 24, 2025 05:08
Copy link
Contributor

@kyri-petrou kyri-petrou left a comment

Choose a reason for hiding this comment

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

Awesome work! Just a minor comment

@@ -0,0 +1,65 @@
package zio.test.magnolia
Copy link
Contributor

Choose a reason for hiding this comment

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

I haven't read through the code too closely, but do we need this to be in the magnolia package? Afaict we're not using magnolia here (or maybe we are and I missed it, in that case please ignore me)

Copy link
Member Author

@guizmaii guizmaii Mar 24, 2025

Choose a reason for hiding this comment

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

We're not using Magnolia here indeed. Where should I put this?

Did a quick research. DeriveGen is a concept coming from zio-test-magnolia module

Copy link
Member Author

@guizmaii guizmaii Mar 27, 2025

Choose a reason for hiding this comment

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

@kyri-petrou Any chance to get this merged, please? I need it at work

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry I'm getting way too many github notifications and I missed this. Merging now :)

@kyri-petrou kyri-petrou merged commit 873668f into series/2.x Mar 28, 2025
18 checks passed
@kyri-petrou kyri-petrou deleted the union_type_gen branch March 28, 2025 05:27
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.

2 participants