Packages

c

scala.reflect.api.Trees

NewExtractor

abstract class NewExtractor extends AnyRef

An extractor class to create and pattern match with syntax New(tpt). This AST node corresponds to the following Scala code:

new T

This node always occurs in the following context:

(new tpt).<init>[targs](args)

For example, an AST representation of:

new Example[Int](2)(3)

is the following code:

Apply( Apply( TypeApply( Select(New(TypeTree(typeOf[Example])), nme.CONSTRUCTOR) TypeTree(typeOf[Int])), List(Literal(Constant(2)))), List(Literal(Constant(3))))

Source
Trees.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NewExtractor
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new NewExtractor()

Abstract Value Members

  1. abstract def apply(tpt: Universe.Tree): Universe.New
  2. abstract def unapply(new_: Universe.New): Option[Universe.Tree]