dotty.tools.dotc.transform.PatternMatcher.Translator.TreeMakers

SubstOnlyTreeMaker

Related Doc: package TreeMakers

case class SubstOnlyTreeMaker(prevBinder: Symbol, nextBinder: Symbol) extends TreeMaker with Product with Serializable

In scalac for such block x match { case d => <body> }

d inside <body> was to be substitued by x.

In dotty, SubstOnlyTreeMakers instead generate normal ValDef, and does not create a new substitution.

This was done for several reasons: 1) it is a lot easyer to Y-check, as d type could be used in <body>. 2) it would simplify debugging of the generated code as this works also for nested patterns, and previously they used unreadable names 3) It showed better(~30%), performance, Rebuilding tree and propagating types was taking substantial time.

Linear Supertypes
Serializable, Serializable, Product, Equals, TreeMaker, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SubstOnlyTreeMaker
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. TreeMaker
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SubstOnlyTreeMaker(prevBinder: Symbol, nextBinder: Symbol)

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def chainBefore(next: ast.tpd.Tree)(casegen: TreeMakers.Casegen): ast.tpd.Tree

    Definition Classes
    SubstOnlyTreeMakerTreeMaker
  6. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  8. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  10. val introducedRebindings: Rebindings

    Definition Classes
    SubstOnlyTreeMakerTreeMaker
  11. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  13. val nextBinder: Symbol

  14. final def notify(): Unit

    Definition Classes
    AnyRef
  15. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  16. val pos: Position

    Definition Classes
    SubstOnlyTreeMakerTreeMaker
  17. val prevBinder: Symbol

  18. def rebindings: Rebindings

    captures the scope and the value of the bindings in patterns important *when* the substitution happens (can't accumulate and do at once after the full matcher has been constructed)

    captures the scope and the value of the bindings in patterns important *when* the substitution happens (can't accumulate and do at once after the full matcher has been constructed)

    Definition Classes
    TreeMaker
  19. def subPatternsAsRebindings: Rebindings

    The substitution that specifies the trees that compute the values of the subpattern binders.

    The substitution that specifies the trees that compute the values of the subpattern binders.

    Should not be used to perform actual substitution! Only used to reason symbolically about the values the subpattern binders are bound to. See TreeMakerToCond#updateSubstitution.

    Overridden in PreserveSubPatBinders to pretend it replaces the subpattern binders by subpattern refs (Even though we don't do so anymore -- see SI-5158, SI-5739 and SI-6070.)

    TODO: clean this up, would be nicer to have some higher-level way to compute the binders bound by this tree maker and the symbolic values that correspond to them

    Definition Classes
    TreeMaker
  20. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  21. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from TreeMaker

Inherited from AnyRef

Inherited from Any

Ungrouped