-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Inline unapply patterns #8530
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
Comments
Couldn't we generate a lambda that corresponds to the unapply instead ? |
The lambda was my first thought. But it might be hard to distinguish unapply from unapplySeq. |
Just a thought - if this works with |
Uh oh!
There was an error while loading. Please reload this page.
We want to be able to support the following kind of use case
where the call to
MyPattern.unapply
will get inline and possibly be a macro.Technically, this would mean generating a new instance with a compatible definition of the unapply and then inline the code in it's body. The return type would be inferred from the expansion of the unapply (whiteboxity). The anonymous class could be optimized away when the pattern matching compiled to labeled blocks.
The text was updated successfully, but these errors were encountered: