dotty.tools.dotc.transform.BetaReduce
See theBetaReduce companion class
Attributes
Companion
class
Graph
Reset zoom Hide graph Show graph
Supertypes
trait Matchable
class Any
Self type
Members list
Rewrite an application
((x1, ..., xn) => b)(e1, ..., en)
to
val/def x1 = e1; ...; val/def xn = en; b
where def is used for call-by-name parameters. However, we shortcut any NoPrefix refs among the ei's directly without creating an intermediate binding.
Similarly, rewrites type applications
([X1, ..., Xm] => (x1, ..., xn) => b).apply[T1, .., Tm](e1, ..., en)
to
type X1 = T1; ...; type Xm = Tm;val/def x1 = e1; ...; val/def xn = en; b
This beta-reduction preserves the integrity of Inlined tree nodes.
Attributes
Beta-reduces a call to ddef with arguments args and registers new bindings.
Beta-reduces a call to ddef with arguments args and registers new bindings.
Attributes
Returns
optionally, the expanded call, or none if the actual argument lists do not match in shape the formal parameters