-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add reflect MatchCase
TypeRepr
#10735
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
Add reflect MatchCase
TypeRepr
#10735
Conversation
fbf58d9
to
c65fe68
Compare
This represents the `MATCHCASEtype` type in `TastyFormat` and hides the `scala.runtime.MatchCase` internal encoding.
c65fe68
to
a207caa
Compare
I'm not certain how I feel about this. In comparison to the other PR, it seems to still have the following issues:
OTOH, if I consider how we expose pat-mat patterns in Reflect, this approach seems analogous. |
We discussed it with @odersky and @OlivierBlanvillain and come to the conclusion that this was the best approach.
This is precisely what we need to expose at it is the concept that is in the TASTy spec
That is true for any feature in the reflect API. Now that documentation mentions the expected shapes of types.
No, now we only depend on the |
That's a fair point in the sense that the Reflect API is supposed to be low-level and not often used, but I think this is far less true for most features of Reflect than it is for match type cases. I'd expect that there are already a lot of people out there that understand that source code is represented as trees, which gets you 95% to understanding how to use most of Reflect. In contrast, we encode information in the shape of match trees in Scala3-specific way. Somebody who sees the Reflect API for the first time will have absolutely no idea how match cases are represented. I guess good documentation is one way of dealing with this.
I don't understand this, are you saying that we will be free to modify what the reference to |
I agree that it's unfortunate that The diff LGTM. |
This represents the
MATCHCASEtype
type inTastyFormat
and hides thescala.runtime.MatchCase
internal encoding.This is an alternative to #10690