dotty.tools.dotc.typer

EtaExpansion

Related Doc: package typer

object EtaExpansion

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. EtaExpansion
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

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 clone(): AnyRef

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

    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  8. def etaExpand(tree: ast.tpd.Tree, mt: MethodType, xarity: Int)(implicit ctx: Context): ast.untpd.Tree

    Eta-expanding a tree means converting a method reference to a function value.

    Eta-expanding a tree means converting a method reference to a function value.

    tree

    The tree to expand

    mt

    The type of the method reference

    xarity

    The arity of the expected function type and assume the lifted application of tree (@see liftApp) is

    { val xs = es; expr }

    If xarity matches the number of parameters in mt, the eta-expansion is

    { val xs = es; (x1, ..., xn) => expr(x1, ..., xn) }

    Note that the function value's parameters are untyped, hence the type will be supplied by the environment (or if missing be supplied by the target method as a fallback). On the other hand, if xarity is different from the number of parameters in mt, then we cannot propagate parameter types from the expected type, and we fallback to using the method's original parameter types instead.

    In either case, the result is an untyped tree, with es and expr as typed splices.

  9. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  11. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  13. def liftApp(defs: ListBuffer[ast.tpd.Tree], tree: ast.tpd.Tree)(implicit ctx: Context): ast.tpd.Tree

    Lift out function prefix and all arguments from application

    Lift out function prefix and all arguments from application

    pre.f(arg1, ..., argN) becomes

    val x0 = pre val x1 = arg1 ... val xN = argN x0.f(x1, ..., xN)

    But leave idempotent expressions alone.

  14. def liftArg(defs: ListBuffer[ast.tpd.Tree], arg: ast.tpd.Tree, prefix: String = "")(implicit ctx: Context): ast.tpd.Tree

    Lift a function argument, stripping any NamedArg wrapper

  15. def liftArgs(defs: ListBuffer[ast.tpd.Tree], methRef: Type, args: List[ast.tpd.Tree])(implicit ctx: Context): List[ast.tpd.Tree]

    Lift arguments that are not-idempotent into ValDefs in buffer defs and replace by the idents of so created ValDefs.

  16. def liftAssigned(defs: ListBuffer[ast.tpd.Tree], tree: ast.tpd.Tree)(implicit ctx: Context): ast.tpd.Tree

    Lift out common part of lhs tree taking part in an operator assignment such as

    Lift out common part of lhs tree taking part in an operator assignment such as

    lhs += expr

  17. def liftPrefix(defs: ListBuffer[ast.tpd.Tree], tree: ast.tpd.Tree)(implicit ctx: Context): ast.tpd.Tree

    Lift prefix pre of an application pre.f(...) to

    Lift prefix pre of an application pre.f(...) to

    val x0 = pre x0.f(...)

    unless pre is a New or pre is idempotent.

  18. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  19. final def notify(): Unit

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

    Definition Classes
    AnyRef
  21. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  22. def toString(): String

    Definition Classes
    AnyRef → Any
  23. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped