Packages

case class OriginalTreeAttachment(original: Global.Tree) extends Product with Serializable

Marks a tree that has been adapted by typer and sets the original tree that was in place before.

Keeping track of the original trees were is an important feature for some compiler plugins (like Scalameta) and the incremental compiler (Zinc). In both cases, adapting trees loses information in some sense and do not allow external tools to capture some information stored in user-defined trees that are optimized away by early phases (mostly, typer).

See how the absence of this attachment blocks Zinc: https://github.com/sbt/zinc/issues/227. Related: https://github.com/scala/scala-dev/issues/340.

This attachment is, at the moment, only used to keep track of constant-folded constants. It has a generic wording in the hope that in the future can be reused in the same context to keep track of other adapted trees.

Source
StdAttachments.scala
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. OriginalTreeAttachment
  2. Serializable
  3. Product
  4. Equals
  5. AnyRef
  6. 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 OriginalTreeAttachment(original: Global.Tree)

Value Members

  1. val original: Global.Tree
  2. def productElementNames: Iterator[String]
    Definition Classes
    Product