-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[SUPERSEDED] Unit companion is compileTimeOnly #7567
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
Conversation
|
If you don't want people to accidentally access the unit companion object |
|
@lihaoyi I don't disagree with you, see https://twitter.com/dwijnand/status/1073149475936485376 which says apparently anyone can confuse it. I'm just trying to help the folks on current version of Scala, using available mechanisms. Also note that there are no weird tricks here. (Edit: the weird specializable idiom using the companion object is not great and also determines the name.) |
|
Heh, even @odersky confused them on stage at ScalaExchange :) |
|
Of course, this makes it harder to test methods on Unit. |
|
I think it worked: |
a819871 to
dfcc5db
Compare
This comment has been minimized.
This comment has been minimized.
Annotations get a dispensation for the ref check. The `Group` mechanism for specialized is moved to the type level.
Add some convenience groups to Specializable and avoid usages of Unit companion in library so that Unit companion can be compileTimeOnly without compiler assistance.
dfcc5db to
ff9a527
Compare
|
Probably this PR had seniority over recent efforts to leave fingerprints on |
|
@eed3si9n's turn to PR again? |
|
new hotness is #7698 |
Annotations get a dispensation for the ref check.
The
Groupmechanism for specialized only uses the type args, so avoid usingUnitto define a value.Forward ports #6490, which didn't cope with
Groupdefinitions.