sealed case class Closure(flags: ClosureFlags, captureParams: List[ParamDef], params: List[ParamDef], restParam: Option[ParamDef], resultType: Type, body: Tree, captureValues: List[Tree])(implicit pos: Position) extends Tree with Product with Serializable
Closure with explicit captures.
If flags.typed is true, this is a typed closure with a ClosureType.
In that case, flags.arrow must be true, and restParam must be
None. Typed closures cannot be passed to JavaScript code. This is
enforced at the type system level, since ClosureTypes are not subtypes
of AnyType. The only meaningful operation one can perform on a typed
closure is to call it using ApplyTypedClosure.
If flags.typed is false, this is a JavaScript closure with type
AnyNotNullType. In that case, the ptpe or all params and
resultType must all be AnyType.
If flags.arrow is true, the closure is an Arrow Function (=>),
which does not have a this parameter, and cannot be constructed (called
with new). If false, it is a regular Function (function), which
does have a this parameter of type AnyType. Typed closures are always
Arrow functions, since they do not have a this parameter.
If flags.async is true, it is an async closure. Async closures
return a Promise of their body, and can contain JSAwait nodes.
flags.typed and flags.async cannot both be true.
- Alphabetic
- By Inheritance
- Closure
- Serializable
- Product
- Equals
- Tree
- TreeOrJSSpread
- IRNode
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
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
- val body: Tree
- val captureParams: List[ParamDef]
- val captureValues: List[Tree]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- val flags: ClosureFlags
- final def getClass(): Class[_ <: AnyRef]
- 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()
- val params: List[ParamDef]
- implicit val pos: Position
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- val restParam: Option[ParamDef]
- val resultType: Type
- 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(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()