Skip to content

Use attachment to tag backquoted trees #6755

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 5 commits into from
Jun 26, 2019

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jun 26, 2019

No description provided.

@@ -337,7 +337,6 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
def Alternative(trees: List[Tree])(implicit src: SourceFile): Alternative = new Alternative(trees)
def UnApply(fun: Tree, implicits: List[Tree], patterns: List[Tree])(implicit src: SourceFile): UnApply = new UnApply(fun, implicits, patterns)
def ValDef(name: TermName, tpt: Tree, rhs: LazyTree)(implicit src: SourceFile): ValDef = new ValDef(name, tpt, rhs)
def BackquotedValDef(name: TermName, tpt: Tree, rhs: LazyTree)(implicit src: SourceFile): ValDef = new BackquotedValDef(name, tpt, rhs)
def DefDef(name: TermName, tparams: List[TypeDef], vparamss: List[List[ValDef]], tpt: Tree, rhs: LazyTree)(implicit src: SourceFile): DefDef = new DefDef(name, tparams, vparamss, tpt, rhs)
def BackquotedDefDef(name: TermName, tparams: List[TypeDef], vparamss: List[List[ValDef]], tpt: Tree, rhs: LazyTree)(implicit src: SourceFile): DefDef = new BackquotedDefDef(name, tparams, vparamss, tpt, rhs)
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this one was accidentally kept.

@smarter
Copy link
Member

smarter commented Jun 26, 2019

What's the motivation for this change ?

@odersky
Copy link
Contributor Author

odersky commented Jun 26, 2019

The motivation is to simplify. We get more and more Backquoted subclasses (quoted patterns would add a BackquotedTypeDef class), which leads to needless duplication of code.

Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

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

LGTM, but have you considered using a NameKind to represent backquoting instead ?

@odersky
Copy link
Contributor Author

odersky commented Jun 26, 2019

LGTM, but have you considered using a NameKind to represent backquoting instead ?

I did. It messes up other things. In particular, Name equality (x and x are the same name).

Yes, we did consider it.

@odersky odersky merged commit 42c422b into scala:master Jun 26, 2019
@allanrenucci allanrenucci deleted the drop-backquoted branch June 26, 2019 20:21
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