Tags a .withFilter call generated by desugaring a for expression.
Tags a .withFilter call generated by desugaring a for expression. Such calls can alternatively be rewritten to use filter.
Main desugaring method
{ stats; <empty > }
{ stats; <empty > }
The name of mdef
, after checking that it does not redefine a Scala core class.
The name of mdef
, after checking that it does not redefine a Scala core class.
If it does redefine, issue an error and return a mangled name instead of the original one.
The expansion of a class definition.
The expansion of a class definition. See inline comments for what is involved
Expand context bounds to evidence params.
Expand context bounds to evidence params. E.g.,
def f[T >: L <: H : B](params)
Expand default arguments to default getters. E.g,
def f[T: B](x: Int = 1)(y: String = x + "m") = ...
A value definition copied from vdef
with a tpt typetree derived from it
A type definition copied from tdef
with a rhs typetree derived from it
Names of methods that are added unconditionally to case classes
Add annotation with class cls
to tree:
tree @cls
If nparams
== 1, expand partial function
If nparams
== 1, expand partial function
{ cases }
If nparams
!= 1, expand instead to
(x$1, ..., x$n) => (x$0, ..., x${n-1} @unchecked) match { cases }
Make closure corresponding to function.
Make closure corresponding to function. params => body
If inlineable
is true, tag $anonfun with an @inline annotation.
If pat
is a variable pattern,
If pat
is a variable pattern,
val/var/lazy val p = e
Otherwise, in case there is exactly one variable x_1 in pattern val/var/lazy val p = e ==> val/var/lazy val x_1 = (e: @unchecked) match (case p => (x_1))
in case there are zero or more than one variables in pattern val/var/lazy p = e ==> private synthetic [lazy] val t$ = (e: @unchecked) match (case p => (x_1, ..., x_N)) val/var/def x_1 = t$._1 ... val/var/def x_N = t$._N If the original pattern variable carries a type annotation, so does the corresponding ValDef or DefDef.
Map n-ary function (p1, ..., pn) => body
where n != 1 to unary function as follows:
Map n-ary function (p1, ..., pn) => body
where n != 1 to unary function as follows:
x$1 => { def p1 = x$1._1 ... def pn = x$1._n body }
Expand
Expand
object name extends parents { self => body }
to: <module> val name: name$ = New(name$) <module> final class name$ extends parents { self: name.type => body }
val p1, ..., pN: T = E
val p1, ..., pN: T = E
Expand variable identifier x to x @ _
Create a class definition with the same info as the refined type given by parent
and refinements
.
Create a class definition with the same info as the refined type given by parent
and refinements
.
parent { refinements }
Here, core
is the (possibly parameterized) class part of parent
.
If parent
is the same as core
, self is empty. Otherwise self
is parent
.
Example: Given
class C type T1 = C { type T <: A }
the refined type
T1 { type T <: B }
is expanded to
trait <refinement> extends C { this: T1 => type T <: A }
The result of this method is used for validity checking, is thrown away afterwards.
The type of parent
EmptyTree in lower bound ==> Nothing EmptyTree in upper bounds ==> Any
Fill in empty type bounds with Nothing/Any.
Fill in empty type bounds with Nothing/Any. Expand private local type parameters as follows:
class C[v T]
var x: Int = expr
var x: Int = expr