sealed case class NewLambda(descriptor: Descriptor, fun: Tree)(tpe: Type)(implicit pos: Position) extends Tree with Product with Serializable
New lambda instance of a SAM class.
Functionally, a NewLambda
is equivalent to an instance of an anonymous
class with the following shape:
val funV: ((...Ts) => R)! = fun; (new superClass with interfaces { def <this>() = this.superClass::<init>() def methodName(...args: Ts): R = funV(...args) }): tpe
where superClass
, interfaces
, methodName
, Ts
and R
are taken
from the descriptor
. Ts
and R
are the paramTypes
and resultType
of the descriptor. They are required because there is no one-to-one
mapping between TypeRef
s and Type
s, and we want the shape of the
class to be a deterministic function of the descriptor
.
The fun
must have type ((...Ts) => R)!
.
Intuitively, tpe
must be a supertype of superClass! & ...interfaces!
.
Since our type system does not have intersection types, in practice this
means that there must exist C ∈ { superClass } ∪ interfaces
such that
tpe
is a supertype of C!
.
The uniqueness of the anonymous class and its run-time class name are not guaranteed.
- Alphabetic
- By Inheritance
- NewLambda
- Serializable
- Serializable
- Product
- Equals
- Tree
- TreeOrJSSpread
- IRNode
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new NewLambda(descriptor: Descriptor, fun: Tree)(tpe: Type)(implicit pos: Position)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- val descriptor: Descriptor
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- val fun: Tree
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- implicit val pos: Position
-
def
show: String
- Definition Classes
- IRNode
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- val tpe: Type
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )