Skip to content

Backport "Fix ctx implicits under case unapplySeq" to 3.3 LTS #61

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
Feb 14, 2025

Conversation

tgodzik
Copy link

@tgodzik tgodzik commented Feb 13, 2025

Backports scala#21748 to the 3.3.6.

PR submitted by the release tooling.
[skip ci]

A case class with a varargs has a unapplySeq extractor instead of
unapply.  When we type an unapply, in typedUnapply, we first look for
unapply methods before unapplySeq methods.  But when searching for
unapply, if a class method isn't found, then an extension method is
looked for, which causes context implicits to be cached.  The bindings
from a pattern (such as from an unapply or unapplySeq extractor) are
added to the context in indexPattern.  But Context's `implicitCache`
doesn't account for the scope changing.

I opted for giving the body its own scope context, rather than making
indexPattern reset the context implicits cache.

[Cherry-picked 69f5f73]
Base automatically changed from backport-lts-3.3-21836 to lts-3.3 February 14, 2025 15:25
@tgodzik
Copy link
Author

tgodzik commented Feb 14, 2025

No regressions detected in the community build up to backport-lts-3.3-21842.

Reference

@tgodzik tgodzik merged commit ef2527c into lts-3.3 Feb 14, 2025
22 checks passed
@tgodzik tgodzik deleted the backport-lts-3.3-21748 branch February 14, 2025 15:25
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.

2 participants