-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Replace package object compiletime by top-level definitions; move compiletime.S to compiletime.ops.int.S #11745
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
a4afd77
to
7bb74f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If S
moves, we need to update the documentation here: https://dotty.epfl.ch/docs/reference/metaprogramming/inline.html#constvalue-constvalueopt-and-the-s-combinator
Thanks, I updated the doc (and now I'm also wondering if there's really a usecase for |
I don't really know if there is a use case. One thing I think import scala.compiletime.S
type MinusOne[N <: Int & Singleton] = N match {
case S[n] => n
}
@main def test: Unit = {
val x: MinusOne[3] = 2
} Though of course |
OK, sounds like S is still useful until/unless + becomes more powerful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ebd52f2
to
fe61db5
Compare
Also move S from scala.compiletime to scala.compiletime.ops.int where all the other type operators on Int are defined.
[test_non_bootstrapped]