-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add quoted patterns #6198
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 quoted patterns #6198
Conversation
@@ -16,4 +16,7 @@ object Quoted { | |||
def typeQuote[T <: AnyKind]: Type[T] = | |||
throw new Error("Internal error: this method call should have been replaced by the compiler") | |||
|
|||
/** A splice in a quoted pattern is desugared by the compiler into a call to this method */ | |||
def patternHole[T]: T = |
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.
Note: this is the equivalent to def hole[T]
in #6042, not to be confused with object patternHole { def unapply[T] = ... }
.
Status: FromTasty test fails on |
Also, cleanup some other stuff. Not done with this yet, but it is crucial that we follow the same pattern everywhere in Definition, or otherwise people will get hopelessly confused. Right now some of the more recent additions use naming conventions that deviate from what was intended.
Previously, the case where arity = 1 was treated specially.
Now we can have patterns that do not have a full tree (i.e. just an Ident to the `unapply`)
acc9423
to
3cef701
Compare
Rebased |
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.
Otherwise LGTM
@nicolasstucki Your commits LGTM |
No description provided.