diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/reflect/scala/reflect/api/Trees.scala | 6 | ||||
-rw-r--r-- | src/reflect/scala/reflect/internal/Trees.scala | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/reflect/scala/reflect/api/Trees.scala b/src/reflect/scala/reflect/api/Trees.scala index cfa6315797..e4ee048f84 100644 --- a/src/reflect/scala/reflect/api/Trees.scala +++ b/src/reflect/scala/reflect/api/Trees.scala @@ -89,6 +89,12 @@ trait Trees { self: Universe => */ def isEmpty: Boolean + /** Is this tree one of the empty trees? + * + * @see `isEmpty` + */ + def nonEmpty: Boolean + /** Can this tree carry attributes (i.e. symbols, types or positions)? * Typically the answer is yes, except for the `EmptyTree` null object and * two special singletons: `emptyValDef` and `pendingSuperCall`. diff --git a/src/reflect/scala/reflect/internal/Trees.scala b/src/reflect/scala/reflect/internal/Trees.scala index 9e737528d2..4dad3dd37a 100644 --- a/src/reflect/scala/reflect/internal/Trees.scala +++ b/src/reflect/scala/reflect/internal/Trees.scala @@ -39,6 +39,8 @@ trait Trees extends api.Trees { self: SymbolTable => def isDef = false def isEmpty = false + def nonEmpty = !isEmpty + def canHaveAttrs = true /** The canonical way to test if a Tree represents a term. |