scala.reflect.generic

# Trees

#### trait Trees extends AnyRef

Self Type
  Universe
Annotations
  @deprecated
Deprecated

  (Since version 2.9.1) scala.reflect.generic will be removed

Source
  Trees.scala

Linear Supertypes
AnyRef, Any
Known Subclasses
Universe
Ordering

1. Alphabetic
2. By inheritance

Inherited

1. Hide All
2. Show all

1. Trees
2. AnyRef
3. Any

Visibility

1. Public
2. All

### Type Members

1. #### abstract class AbsTreePrinter extends AnyRef

2. #### abstract class AbsTypeTree extends Tree with TypTree

   A synthetic term holding an arbitrary type.

3. #### case class Alternative(trees: List[Tree]) extends Tree with TermTree with Product with Serializable

   Alternatives of patterns, eliminated by explicitouter, except for occurrences in encoded Switch stmt (=remaining Match(CaseDef(.

4. #### case class Annotated(annot: Tree, arg: Tree) extends Tree with Product with Serializable

   A tree that has an annotation attached to it.

5. #### case class AppliedTypeTree(tpt: Tree, args: List[Tree]) extends Tree with TypTree with Product with Serializable

   Applied type <tpt> [ <args> ], eliminated by RefCheck

6. #### case class Apply(fun: Tree, args: List[Tree]) extends GenericApply with Product with Serializable

   Value application

7. #### case class ApplyDynamic(qual: Tree, args: List[Tree]) extends Tree with TermTree with SymTree with Product with Serializable

   Dynamic value application.

8. #### case class ArrayValue(elemtpt: Tree, elems: List[Tree]) extends Tree with TermTree with Product with Serializable

   Array of expressions, needs to be translated in backend,

9. #### case class Assign(lhs: Tree, rhs: Tree) extends Tree with TermTree with Product with Serializable

   Assignment

10. #### class BackQuotedIdent extends Ident

11. #### case class Bind(name: Name, body: Tree) extends DefTree with Product with Serializable

    Bind of a variable to a rhs pattern, eliminated by explicitouter

12. #### case class Block(stats: List[Tree], expr: Tree) extends Tree with TermTree with Product with Serializable

    Block of expressions (semicolon separated expressions)

13. #### case class CaseDef(pat: Tree, guard: Tree, body: Tree) extends Tree with Product with Serializable

    Case clause in a pattern match, eliminated during explicitouter (except for occurrences in switch statements)

14. #### case class ClassDef(mods: Modifiers, name: TypeName, tparams: List[TypeDef], impl: Template) extends ImplDef with Product with Serializable

    Class definition

15. #### case class CompoundTypeTree(templ: Template) extends Tree with TypTree with Product with Serializable

    Intersection type <parent1> with .

16. #### case class DefDef(mods: Modifiers, name: TermName, tparams: List[TypeDef], vparamss: List[List[ValDef]], tpt: Tree, rhs: Tree) extends ValOrDefDef with Product with Serializable

    Method definition

17. #### abstract class DefTree extends Tree with SymTree

18. #### case class ExistentialTypeTree(tpt: Tree, whereClauses: List[Tree]) extends Tree with TypTree with Product with Serializable

19. #### case class Function(vparams: List[ValDef], body: Tree) extends Tree with TermTree with SymTree with Product with Serializable

    Anonymous function, eliminated by analyzer

20. #### abstract class GenericApply extends Tree with TermTree

21. #### case class Ident(name: Name) extends Tree with RefTree with Product with Serializable

    Identifier <name>

22. #### case class If(cond: Tree, thenp: Tree, elsep: Tree) extends Tree with TermTree with Product with Serializable

    Conditional expression

23. #### abstract class ImplDef extends MemberDef

24. #### case class Import(expr: Tree, selectors: List[ImportSelector]) extends Tree with SymTree with Product with Serializable

    Import clause

25. #### case class ImportSelector(name: Name, namePos: Int, rename: Name, renamePos: Int) extends Product with Serializable

    Import selector

26. #### case class LabelDef(name: TermName, params: List[Ident], rhs: Tree) extends DefTree with TermTree with Product with Serializable

    Labelled expression - the symbols in the array (must be Idents!) are those the label takes as argument

27. #### case class Literal(value: Constant) extends Tree with TermTree with Product with Serializable

    Literal

28. #### case class Match(selector: Tree, cases: List[CaseDef]) extends Tree with TermTree with Product with Serializable

    - Pattern matching expression (before explicitouter)

29. #### abstract class MemberDef extends DefTree

30. #### case class Modifiers(flags: Long, privateWithin: Name, annotations: List[Tree], positions: Map[Long, Position]) extends HasFlags with Product with Serializable

31. #### case class ModuleDef(mods: Modifiers, name: TermName, impl: Template) extends ImplDef with Product with Serializable

    Singleton object definition

32. #### case class New(tpt: Tree) extends Tree with TermTree with Product with Serializable

    Object instantiation One should always use factory method below to build a user level new.

33. #### case class PackageDef(pid: RefTree, stats: List[Tree]) extends MemberDef with Product with Serializable

    Package clause

34. #### trait RefTree extends Tree with SymTree

35. #### case class Return(expr: Tree) extends Tree with TermTree with SymTree with Product with Serializable

    Return expression

36. #### case class Select(qualifier: Tree, name: Name) extends Tree with RefTree with Product with Serializable

    Designator <qualifier> .

37. #### case class SelectFromArray(qualifier: Tree, name: Name, erasure: Type) extends Tree with TermTree with RefTree with Product with Serializable

    Array selection <qualifier> .

38. #### case class SelectFromTypeTree(qualifier: Tree, name: TypeName) extends Tree with TypTree with RefTree with Product with Serializable

    Type selection <qualifier> # <name>, eliminated by RefCheck

39. #### case class SingletonTypeTree(ref: Tree) extends Tree with TypTree with Product with Serializable

    Singleton type, eliminated by RefCheck

40. #### case class Star(elem: Tree) extends Tree with TermTree with Product with Serializable

    Repetition of pattern, eliminated by explicitouter

41. #### case class Super(qual: Tree, mix: TypeName) extends Tree with TermTree with Product with Serializable

    Super reference, qual = corresponding this reference

42. #### trait SymTree extends Tree

43. #### case class Template(parents: List[Tree], self: ValDef, body: List[Tree]) extends Tree with SymTree with Product with Serializable

    Instantiation template of a class or trait

44. #### trait TermTree extends Tree

45. #### case class This(qual: TypeName) extends Tree with TermTree with SymTree with Product with Serializable

    Self reference

46. #### case class Throw(expr: Tree) extends Tree with TermTree with Product with Serializable

    Throw expression

47. #### class Traverser extends AnyRef

48. #### abstract class Tree extends Product

49. #### case class Try(block: Tree, catches: List[CaseDef], finalizer: Tree) extends Tree with TermTree with Product with Serializable

50. #### trait TypTree extends Tree

    A tree for a type.

51. #### case class TypeApply(fun: Tree, args: List[Tree]) extends GenericApply with Product with Serializable

    Type application

52. #### case class TypeBoundsTree(lo: Tree, hi: Tree) extends Tree with TypTree with Product with Serializable

53. #### case class TypeDef(mods: Modifiers, name: TypeName, tparams: List[TypeDef], rhs: Tree) extends MemberDef with Product with Serializable

    Abstract type, type parameter, or type alias

54. #### abstract type TypeTree <: AbsTypeTree

55. #### abstract class TypeTreeExtractor extends AnyRef

56. #### case class Typed(expr: Tree, tpt: Tree) extends Tree with TermTree with Product with Serializable

    Type annotation, eliminated by explicit outer

57. #### case class UnApply(fun: Tree, args: List[Tree]) extends Tree with TermTree with Product with Serializable

58. #### case class ValDef(mods: Modifiers, name: TermName, tpt: Tree, rhs: Tree) extends ValOrDefDef with Product with Serializable

    Value definition

59. #### abstract class ValOrDefDef extends MemberDef

### Abstract Value Members

1. #### abstract val TypeTree: TypeTreeExtractor

2. #### abstract def flagsIntoString(flags: Long, privateWithin: String): String

   Attributes
     protected

3. #### abstract def newTreePrinter(out: PrintWriter): AbsTreePrinter

### Concrete Value Members

1. #### final def !=(arg0: AnyRef): Boolean

   Definition Classes
     AnyRef

2. #### final def !=(arg0: Any): Boolean

   Test two objects for inequality.

   Test two objects for inequality.

   returns

     `true` if !(this == that), false otherwise.

   Definition Classes
     Any

3. #### final def ##(): Int

   Equivalent to `x.hashCode` except for boxed numeric types.

   Equivalent to `x.hashCode` except for boxed numeric types. For numerics, it returns a hash value which is consistent with value equality: if two value type instances compare as true, then ## will produce the same hash value for each of them.

   returns

     a hash value consistent with ==

   Definition Classes
     AnyRef → Any

4. #### final def ==(arg0: AnyRef): Boolean

   Definition Classes
     AnyRef

5. #### final def ==(arg0: Any): Boolean

   Test two objects for equality.

   Test two objects for equality.

   returns

     `true` if the receiver object is equivalent to the argument; `false` otherwise.

   Definition Classes
     Any

6. #### object EmptyTree extends Tree with TermTree with Product with Serializable

   The empty tree

7. #### def Literal(value: Any): Literal

8. #### def Modifiers(flags: Long): Modifiers

9. #### def Modifiers(flags: Long, privateWithin: Name): Modifiers

10. #### lazy val NoMods: Modifiers

11. #### final def asInstanceOf[T0]: T0

    Cast the receiver object to be of type `T0`.

    Cast the receiver object to be of type `T0`.

    Note that the success of a cast at runtime is modulo Scala's erasure semantics. Therefore the expression `1.asInstanceOf[String]` will throw a `ClassCastException` at runtime, while the expression `List(1).asInstanceOf[List[String]]` will not. In the latter example, because the type argument is erased as part of compilation it is not possible to check whether the contents of the list are of the requested type.

    returns

      the receiver object.

    Definition Classes
      Any
    Exceptions thrown
      ClassCastException

      if the receiver object is not an instance of the erasure of type `T0`.

12. #### def clone(): AnyRef

    Create a copy of the receiver object.

    Create a copy of the receiver object.

    The default implementation of the `clone` method is platform dependent.

    returns

      a copy of the receiver object.

    Attributes
      protected[lang]
    Definition Classes
      AnyRef
    Annotations
      @throws()
    Note

      not specified by SLS as a member of AnyRef

13. #### final def eq(arg0: AnyRef): Boolean

    Tests whether the argument (`arg0`) is a reference to the receiver object (`this`).

    Tests whether the argument (`arg0`) is a reference to the receiver object (`this`).

    The `eq` method implements an equivalence relation on non-null instances of `AnyRef`, and has three additional properties:

    - It is consistent: for any non-null instances `x` and `y` of type `AnyRef`, multiple invocations of `x.eq(y)` consistently returns `true` or consistently returns `false`.
    - For any non-null instance `x` of type `AnyRef`, `x.eq(null)` and `null.eq(x)` returns `false`.
    - `null.eq(null)` returns `true`.

    When overriding the `equals` or `hashCode` methods, it is important to ensure that their behavior is consistent with reference equality. Therefore, if two objects are references to each other (`o1 eq o2`), they should be equal to each other (`o1 == o2`) and they should hash to the same value (`o1.hashCode == o2.hashCode`).

    returns

      `true` if the argument is a reference to the receiver object; `false` otherwise.

    Definition Classes
      AnyRef

14. #### def equals(arg0: Any): Boolean

    The equality method for reference types.

    The equality method for reference types. See equals in Any.

    returns

      `true` if the receiver object is equivalent to the argument; `false` otherwise.

    Definition Classes
      AnyRef → Any

15. #### def finalize(): Unit

    Called by the garbage collector on the receiver object when there are no more references to the object.

    Called by the garbage collector on the receiver object when there are no more references to the object.

    The details of when and if the `finalize` method is invoked, as well as the interaction between `finalize` and non-local returns and exceptions, are all platform dependent.

    Attributes
      protected[lang]
    Definition Classes
      AnyRef
    Annotations
      @throws()
    Note

      not specified by SLS as a member of AnyRef

16. #### final def getClass(): java.lang.Class[_]

    A representation that corresponds to the dynamic class of the receiver object.

    A representation that corresponds to the dynamic class of the receiver object.

    The nature of the representation is platform dependent.

    returns

      a representation that corresponds to the dynamic class of the receiver object.

    Definition Classes
      AnyRef → Any
    Note

      not specified by SLS as a member of AnyRef

17. #### def hashCode(): Int

    The hashCode method for reference types.

    The hashCode method for reference types. See hashCode in Any.

    returns

      the hash code value for this object.

    Definition Classes
      AnyRef → Any

18. #### final def isInstanceOf[T0]: Boolean

    Test whether the dynamic type of the receiver object is `T0`.

    Test whether the dynamic type of the receiver object is `T0`.

    Note that the result of the test is modulo Scala's erasure semantics. Therefore the expression `1.isInstanceOf[String]` will return `false`, while the expression `List(1).isInstanceOf[List[String]]` will return `true`. In the latter example, because the type argument is erased as part of compilation it is not possible to check whether the contents of the list are of the specified type.

    returns

      `true` if the receiver object is an instance of erasure of type `T0`; `false` otherwise.

    Definition Classes
      Any

19. #### final def ne(arg0: AnyRef): Boolean

    Equivalent to `!(this eq that)`.

    Equivalent to `!(this eq that)`.

    returns

      `true` if the argument is not a reference to the receiver object; `false` otherwise.

    Definition Classes
      AnyRef

20. #### final def notify(): Unit

    Wakes up a single thread that is waiting on the receiver object's monitor.

    Wakes up a single thread that is waiting on the receiver object's monitor.

    Definition Classes
      AnyRef
    Note

      not specified by SLS as a member of AnyRef

21. #### final def notifyAll(): Unit

    Wakes up all threads that are waiting on the receiver object's monitor.

    Wakes up all threads that are waiting on the receiver object's monitor.

    Definition Classes
      AnyRef
    Note

      not specified by SLS as a member of AnyRef

22. #### final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
      AnyRef

23. #### def toString(): String

    Creates a String representation of this object.

    Creates a String representation of this object. The default representation is platform dependent. On the java platform it is the concatenation of the class name, "@", and the object's hashcode in hexadecimal.

    returns

      a String representation of the object.

    Definition Classes
      AnyRef → Any

24. #### final def wait(): Unit

    Definition Classes
      AnyRef
    Annotations
      @throws()

25. #### final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
      AnyRef
    Annotations
      @throws()

26. #### final def wait(arg0: Long): Unit

    Definition Classes
      AnyRef
    Annotations
      @throws()

### Inherited from AnyRef

### Inherited from Any