diff options
-rw-r--r-- | src/dotty/tools/dotc/ast/Trees.scala | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/ast/Trees.scala b/src/dotty/tools/dotc/ast/Trees.scala index 2ae494d55..8df486968 100644 --- a/src/dotty/tools/dotc/ast/Trees.scala +++ b/src/dotty/tools/dotc/ast/Trees.scala @@ -180,6 +180,8 @@ object Trees { def tokenPos: Seq[(Token, Position)] = ??? } + private var nextId = 0 + /** Trees take a parameter indicating what the type of their `tpe` field * is. Two choices: `Type` or `Untyped`. * Untyped trees have type `Tree[Untyped]`. @@ -204,6 +206,14 @@ object Trees { if (Stats.enabled) ntrees += 1 + /** A unique identifier for this tree. Used for debugging, and potentially + * tracking presentation compiler interactions + */ + val uniqueId = { + nextId += 1 + nextId + } + /** The type constructor at the root of the tree */ type ThisTree[T >: Untyped] <: Tree[T] |