Skip to content

Fix ambiguous unapply for TASTy reflect Parent #4998

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
Aug 26, 2018

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

@@ -399,4 +397,5 @@ trait TreeOpsImpl extends scala.tasty.reflect.TreeOps with TastyCoreImpl with He
}
}

def termAsParent(term: Term): Parent = term
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems dangerous to me, as any term can now be disguised as Parent. The same for TypeTree. Conceptually, how it is different from making Parent a supertype of Term and TypeTree?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is not conceptually different, but it solves the ambiguity in the extractor when passing a Term as term could be a Tree or a Parent. This will be removed when we bootstrap and I'll be able to define type Parent = Term | TypeTree and have a simple extractor for both.

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.

LGTM

@nicolasstucki nicolasstucki merged commit 37eacd9 into scala:master Aug 26, 2018
@Blaisorblade Blaisorblade deleted the fix-parents-tasty-reflect branch August 26, 2018 12:10
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