desugar
Members list
Type members
Classlikes
A type tree that computes its type from an existing parameter.
A type tree that computes its type from an existing parameter.
Attributes
- Supertypes
-
class DerivedTypeTreetrait Serializableclass DenotingTree[Untyped]trait Showabletrait Containertrait LinkSourceclass Positionedtrait Cloneabletrait Producttrait Equalstrait SrcPosclass Objecttrait Matchableclass AnyShow all
What static check should be applied to a Match?
What static check should be applied to a Match?
Attributes
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class DerivedTypeTreetrait Serializableclass DenotingTree[Untyped]trait Showabletrait Containertrait LinkSourceclass Positionedtrait Cloneabletrait Producttrait Equalstrait SrcPosclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class DerivedTypeTreetrait Serializableclass DenotingTree[Untyped]trait Showabletrait Containertrait LinkSourceclass Positionedtrait Cloneabletrait Producttrait Equalstrait SrcPosclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class DerivedTypeTreetrait Serializableclass DenotingTree[Untyped]trait Showabletrait Containertrait LinkSourceclass Positionedtrait Cloneabletrait Producttrait Equalstrait SrcPosclass Objecttrait Matchableclass AnyShow all
Types
The type of tests that check whether a MemberDef is OK for some flag. The test succeeds if the partial function is defined and returns true.
The type of tests that check whether a MemberDef is OK for some flag. The test succeeds if the partial function is defined and returns true.
Attributes
Value members
Concrete methods
Main desugaring method
Main desugaring method
Attributes
Translate infix operation expression
Translate infix operation expression
l op r ==> l.op(r) if op is left-associative ==> r.op(l) if op is right-associative
Attributes
{ stats;
{ stats;
Attributes
Check that modifiers are legal for the definition tree
. Right now, we only check for opaque
. TODO: Move other modifier checks here.
Check that modifiers are legal for the definition tree
. Right now, we only check for opaque
. TODO: Move other modifier checks here.
Attributes
The expansion of a class definition. See inline comments for what is involved
The expansion of a class definition. See inline comments for what is involved
Attributes
A value definition copied from vdef
with a tpt typetree derived from it
A value definition copied from vdef
with a tpt typetree derived from it
Attributes
A type definition copied from tdef
with a rhs typetree derived from it
A type definition copied from tdef
with a rhs typetree derived from it
Attributes
A derived type definition watching sym
A derived type definition watching sym
Attributes
Transform extension construct to list of extension methods
Transform extension construct to list of extension methods
Attributes
Invent a name for an anonympus given of type or template impl
.
Invent a name for an anonympus given of type or template impl
.
Attributes
Is name
the name of a method that is added unconditionally to case classes?
Is name
the name of a method that is added unconditionally to case classes?
Attributes
Is name
the name of a method that can be invalidated as a compiler-generated case class method if it clashes with a user-defined method?
Is name
the name of a method that can be invalidated as a compiler-generated case class method if it clashes with a user-defined method?
Attributes
Setter generation is needed for:
Setter generation is needed for:
- non-private class members
- all trait members
- all package object members
Attributes
If nparams
== 1, expand partial function
If nparams
== 1, expand partial function
{ cases }
==> x$1 => (x$1 @unchecked?) match { cases }
If nparams
!= 1, expand instead to
(x$1, ..., x$n) => (x$0, ..., x${n-1} @unchecked?) match { cases }
Attributes
Make closure corresponding to function. params => body ==> def $anonfun(params) = body Closure($anonfun)
Make closure corresponding to function. params => body ==> def $anonfun(params) = body Closure($anonfun)
Attributes
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[this] 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.
Attributes
The selector of a match, which depends of the given checkMode
.
The selector of a match, which depends of the given checkMode
.
Value parameters
- sel
-
the original selector
Attributes
- Returns
-
if
checkMode
is - None : sel @unchecked - Exhaustive : sel - IrrefutablePatDef, IrrefutableGenFrom: sel with attachmentCheckIrrefutable -> checkMode
Turn a fucntion value handlerFun
into a catch case for a try. If handlerFun
is a partial function, translate to
Turn a fucntion value handlerFun
into a catch case for a try. If handlerFun
is a partial function, translate to
case ex => val ev$1 = handlerFun if ev$1.isDefinedAt(ex) then ev$1.apply(ex) else throw ex
Otherwise translate to
case ex => handlerFun.apply(ex)
Attributes
Map n-ary function (x1: T1, ..., xn: Tn) => body
where n != 1 to unary function as follows:
Map n-ary function (x1: T1, ..., xn: Tn) => body
where n != 1 to unary function as follows:
(x$1: (T1, ..., Tn)) => { def x1: T1 = x$1._1 ... def xn: Tn = x$1._n body }
or if isGenericTuple
(x$1: (T1, ... Tn) => { def x1: T1 = x$1.apply(0) ... def xn: Tn = x$1.apply(n-1) body }
If some of the Ti's are absent, omit the : (T1, ..., Tn) type ascription in the selector.
Attributes
Expand
Expand
object name extends parents { self => body }
to:
Attributes
The normalized name of mdef
. This means
The normalized name of mdef
. This means
- Check that the name does not redefine a Scala core class. If it does redefine, issue an error and return a mangled name instead of the original one.
- If the name is missing (this can be the case for instance definitions), invent one instead.
Attributes
Group all definitions that can't be at the toplevel in an object named <source>$package
where <source>
is the name of the source file. Definitions that can't be at the toplevel are:
Group all definitions that can't be at the toplevel in an object named <source>$package
where <source>
is the name of the source file. Definitions that can't be at the toplevel are:
- all pattern, value and method definitions
- non-class type definitions
- implicit classes and objects
- "companion objects" of wrapped type definitions (i.e. objects having the same name as a wrapped type)
Attributes
Expand
Expand
package object name { body }
to:
package name { object package
{ body } }
Attributes
Assuming src
contains top-level definition, returns the name that should be using for the package object that will wrap them.
Assuming src
contains top-level definition, returns the name that should be using for the package object that will wrap them.
Attributes
val p1, ..., pN: T = E ==> makePatDefp1: T1 = E; ...; makePatDefpN: TN = E
val p1, ..., pN: T = E ==> makePatDefp1: T1 = E; ...; makePatDefpN: TN = E
case e1, ..., eN
==> expandSimpleEnumCase([case e1]); ...; expandSimpleEnumCase([case eN])
Attributes
Expand variable identifier x to x @ _
Expand variable identifier x to x @ _
Attributes
Convert a tuple pattern with given elems
to a sequence of ValDefs
, skipping elements that are not convertible.
Convert a tuple pattern with given elems
to a sequence of ValDefs
, skipping elements that are not convertible.
Attributes
Add an explicit ascription to the expectedTpt
to every tail splice.
Add an explicit ascription to the expectedTpt
to every tail splice.
'{ x }
->'{ x }
'{ $x }
->'{ $x: T }
'{ if (...) $x else $y }
->'{ if (...) ($x: T) else ($y: T) }
Note that the splice $t: T
will be typed as ${t: Expr[T]}
Attributes
Transforms
Transforms
Attributes
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 }
==> trait
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.
Value parameters
- parent
-
The type of
parent
Attributes
Translate tuple expressions of arity <= 22
Translate tuple expressions of arity <= 22
() ==> () (t) ==> t (t1, ..., tN) ==> TupleN(t1, ..., tN)
Attributes
Translate throws type A throws E1 | ... | En
to $throws[... $throws[A, E1] ... , En].
Translate throws type A throws E1 | ... | En
to $throws[... $throws[A, E1] ... , En].
Attributes
Concrete fields
An attachment for match expressions generated from a PatDef or GenFrom. Value of key == one of IrrefutablePatDef, IrrefutableGenFrom
An attachment for match expressions generated from a PatDef or GenFrom. Value of key == one of IrrefutablePatDef, IrrefutableGenFrom
Attributes
An attachment for companion modules of classes that have a derives
clause. The position value indicates the start position of the template of the deriving class.
An attachment for companion modules of classes that have a derives
clause. The position value indicates the start position of the template of the deriving class.
Attributes
A multi-line infix operation with the infix operator starting a new line. Used for explaining potential errors.
A multi-line infix operation with the infix operator starting a new line. Used for explaining potential errors.
Attributes
An attachment key to indicate that a ValDef originated from parameter untupling.
An attachment key to indicate that a ValDef originated from parameter untupling.