-
Notifications
You must be signed in to change notification settings - Fork 1.1k
toExprOfTuple method with precise types #7047
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
toExprOfTuple method with precise types #7047
Conversation
c462bc7 to
6bc5952
Compare
6bc5952 to
321d083
Compare
eb4b8be to
de89441
Compare
de89441 to
3a72049
Compare
|
Rebased on master |
3a72049 to
3312779
Compare
|
@nicolasstucki I have implemented some extra safety for this one. val tpl2: (Expr[1], 2, Expr[3]) = ('{1}, 2, '{3})
'{val res = ${tpl2.toExprOfTuple}; res} // errorIn the previous implementation, this would have resulted in a class cast exception when doing Hence, here we achieve safety without corrupting the end user's API. I believe this is a better way to go than having an I believe this pattern of having a companion predicate for match types can be a good safeguard when the match type is meant to be a partial type lambda, not a total one, and we need to verify the input type. This still feels rather cumbersome though... Maybe we can find something more idiomatic. Thanks @OlivierBlanvillain for helping with the solution. |
3312779 to
c35d9c1
Compare
4fa3275 to
e7bc58c
Compare
|
Rebased |
|
The CI did not run for some reason |
e7bc58c to
8a51a38
Compare
Blocked by #7046.