diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2017-02-05 12:47:05 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2017-02-05 17:50:05 +0100 |
commit | ac868319ecf75bcffe6000a41379c5c12e92e62e (patch) | |
tree | 4fcef8e1a93bde01abb8fe4ccc4c7e44e28f60f4 /compiler/src/dotty/tools/dotc/ast/Trees.scala | |
parent | da7d7231b7f21fe1085abc569eb783590074a359 (diff) | |
download | dotty-ac868319ecf75bcffe6000a41379c5c12e92e62e.tar.gz dotty-ac868319ecf75bcffe6000a41379c5c12e92e62e.tar.bz2 dotty-ac868319ecf75bcffe6000a41379c5c12e92e62e.zip |
Represent untyped operators as Ident instead of Name
This has two advantages:
- We can distinguish BackquotedIdent from Ident, allowing the user to
use a defined "type `&`", see testcase.
- We get better positions for the operators. This is useful in IDEs, for
example to get the type at point.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/ast/Trees.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/ast/Trees.scala | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/src/dotty/tools/dotc/ast/Trees.scala b/compiler/src/dotty/tools/dotc/ast/Trees.scala index 6dc2c9a13..7ab8de39f 100644 --- a/compiler/src/dotty/tools/dotc/ast/Trees.scala +++ b/compiler/src/dotty/tools/dotc/ast/Trees.scala @@ -334,10 +334,15 @@ object Trees { extends RefTree[T] { type ThisTree[-T >: Untyped] = Ident[T] def qualifier: Tree[T] = genericEmptyTree + + /** Is this a `BackquotedIdent` ? */ + def isBackquoted: Boolean = false } class BackquotedIdent[-T >: Untyped] private[ast] (name: Name) extends Ident[T](name) { + override def isBackquoted: Boolean = true + override def toString = s"BackquotedIdent($name)" } |