Skip to content

Trees: Add toString for AST nodes which are not case classes #625

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
May 31, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/dotty/tools/dotc/ast/Trees.scala
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,9 @@ object Trees {
}

class BackquotedIdent[-T >: Untyped] private[ast] (name: Name)
extends Ident[T](name)
extends Ident[T](name) {
override def toString = "BackquotedIdent($name)"
Copy link
Contributor

Choose a reason for hiding this comment

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

missing the s prefix for string interpolation

Copy link
Member Author

Choose a reason for hiding this comment

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

woops, thanks for catching that.

}

/** qualifier.name */
case class Select[-T >: Untyped] private[ast] (qualifier: Tree[T], name: Name)
Expand All @@ -355,7 +357,9 @@ object Trees {
}

class SelectWithSig[-T >: Untyped] private[ast] (qualifier: Tree[T], name: Name, val sig: Signature)
extends Select[T](qualifier, name)
extends Select[T](qualifier, name) {
override def toString = "SelectWithSig($qualifier, $name, $sig)"
Copy link
Contributor

Choose a reason for hiding this comment

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

here too missing the s for string interpolation

}

/** qual.this */
case class This[-T >: Untyped] private[ast] (qual: TypeName)
Expand Down Expand Up @@ -519,6 +523,7 @@ object Trees {
/** Array(elems) */
class JavaSeqLiteral[T >: Untyped] private[ast] (elems: List[Tree[T]])
extends SeqLiteral(elems) {
override def toString = s"JavaSeqLiteral($elems)"
}

/** A type tree that represents an existing or inferred type */
Expand Down