Skip to content

Fix Tasty reflect patterns with select trees #4675

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
Jun 18, 2018

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise, LGTM

@@ -474,7 +474,7 @@ object TastyImpl extends scala.tasty.Tasty {
object Value extends ValueExtractor {
def unapply(x: Pattern)(implicit ctx: Context): Option[Term] = x match {
case lit: tpd.Literal @unchecked => Some(lit)
case ident: tpd.Ident @unchecked if ident.isTerm => Some(ident)
case ref: tpd.RefTree @unchecked if ref.isTerm => Some(ref)
Copy link
Contributor

@liufengyun liufengyun Jun 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When used in a traverser or accumulator, a method-select may qualify. Also, it may return true for implicit params of extractors. Maybe add a doc for potential misuse.

@nicolasstucki nicolasstucki merged commit 6781480 into scala:master Jun 18, 2018
@allanrenucci allanrenucci deleted the fix-tasty-pattern-ref branch June 18, 2018 13:46
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