Skip to content

Slightly Improved Varargs Extractor #10729

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

Merged
merged 1 commit into from
Dec 24, 2020
Merged

Slightly Improved Varargs Extractor #10729

merged 1 commit into from
Dec 24, 2020

Conversation

CiaraOBrien
Copy link
Contributor

A small change to scala.quoted.Varargs.unapply to make it apply in more circumstances when inlining is involved, as (as far as I can tell/recall) sometimes varargs end up being encoded as Typed(Inlined(EmptyTree, List(), Repeated(elems, _)), _) not Typed(Repeated(elems, _), _) or Inlined(EmptyTree, List(), Typed(Repeated(elems, _), _)) in corner cases, which means the old implementation fails to match in a confusing manner. This improves things substantially in my wacky heavily-inlining macro expansions, and I'm pretty sure it doesn't break anything.

@nicolasstucki
Copy link
Contributor

@CiaraOBrien could you add a test case with the code you have that used to fail. This way we can ensure we will not have a regression on this improvement in the future.

@nicolasstucki
Copy link
Contributor

The implementation looks good

@CiaraOBrien
Copy link
Contributor Author

Sorry, I totally missed this. I have no recollection of what the specific situation was that this solved, but I'll see if I can break the project in question by finding-and-replacing BetterVarargs( with Varargs(.

@nicolasstucki nicolasstucki merged commit 06ea06a into scala:master Dec 24, 2020
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants