Skip to content
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

Resolved "cyclic aliasing or subtyping" #1233

Closed
wants to merge 1 commit into from

Conversation

Krishnakalani111
Copy link

/claims #1183
Fixes #1183

This commit addresses the "cyclic aliasing or subtyping" error that was occurring due to the UserId type being a subtype of UUIDv1, and UUIDv1 being a subtype of UUID. This created a cyclic relationship that the Scala compiler could not resolve.

To resolve this issue, I've used the Newtype and Subtype classes from the ZIO Prelude package to create new types and subtypes in a type-safe way. This has allowed us to avoid the cyclic relationship that was causing the error.

@Krishnakalani111 Krishnakalani111 requested a review from a team as a code owner December 9, 2023 08:09
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@adamgfraser
Copy link
Contributor

This doesn't solve the issue. The original reproducer should work as written. A user should be able to define a subtype of a subtype.

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.

[Scala 2.13] Subtype of Newtype cause cyclic subtyping error
4 participants