-
Notifications
You must be signed in to change notification settings - Fork 45
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
fix: Remove redundant restriction at compile-time #123
Conversation
@Iltotore I still worry about targeting. But anyone who quickly glanced can consider it as wierd validation but not tiny wrapper. On my end, I will do following things:
And I still suggest to refine the naming. If you open to that suggestion, I would open the discussion in the issue and involve more contributors to derive best-sounding option. Or probably I'll be voted out and that is something redundant in general :) |
An alias for |
0d2182e
to
0f42931
Compare
However, I am not sure that
Note: |
I think the two first options work together well. |
Fair enough. I will merge this PR during the weekend and open (or let you do if you prefer) an issue for newcomers. |
I am happy to help :) |
This doesn't compile for me. Am I reading this wrong? opaque type MyUUID = UUID :| Pure
object MyUUID extends RefinedTypeOps.Transparent[MyUUID]
val myuuid = MyUUID(UUID.randomUUID())
|
@nkgm non-AnyVal or String types are currently not checkable at compile-time but might be in the future. See #147. In your case, you can use Also for opaque types you cannot use |
Hi @Iltotore, and thanks for all your hard work in making this possible. I'm aware of the alternatives, just trying to be concise and improve my understanding where I can. I checked #147, but it's the same with opaque type MyLong = Long :| Pure
object MyLong extends RefinedTypeOps[Long, Pure, MyLong]
val myId = MyLong(System.currentTimeMillis()) As noted in RefinedTypeOps.apply:
So unless I'm missing something, the problem lies with the fact that the value can't be inlined. I can see how this is a requirement for actual constraints, but could this restriction not be relaxed for |
The error here is because I suggest you to open a new issue instead of discussing in this already closed PR discussion. |
Should fix #122
This now compiles:
@antonkw, does it solve your problem?