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

Opaque type residing in the same package object as Newtype/Subtype breaks compilation #1167

Open
m-kalai opened this issue Jul 21, 2023 · 1 comment
Assignees

Comments

@m-kalai
Copy link

m-kalai commented Jul 21, 2023

I created simple-as-possible repo to demonstrate this issue -> https://github.com/m-kalai/zio-prelude-opaque-issue

When issue.test.model#Whatever type is just ordinary type alias, code compiles. When this same type becomes opaque type, code compilation fails with:

We were unable to read your assertion at compile-time.

You must either define your assertion directly or refer to other inline definitions:

    override inline def assertion = greaterThan(10) && lessThan(100).

    or

    inline def extracted = greaterThan(10) && lessThan(100).
    override inline def assertion = extracted.

It fails for both CustomerId and CustomerName.

Expected result would be that code compiles. Also this behaviour seems to be exclusive to package objects.

I'd like to help with the fix but i need some guidance.

@sideeffffect
Copy link
Member

Let me try to summon @kitlangton , maybe he'll be able to help.

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

No branches or pull requests

3 participants