class compiler::InitClosures

sys::Obj
  compiler::CompilerSupport
    compiler::CompilerStep
      compiler::InitClosures

Source

During the Parse step we created a list of all the closures. In InitClosures we map each ClosureExpr into a TypeDef as an anonymous class, then we map ClosureExpr.substitute to call the constructor anonymous class.

closure

ClosureExpr? closure

Source

cls

TypeDef? cls

Source

ctor

MethodDef? ctor

Source

doCall

MethodDef? doCall

Source

enclosingType

TypeDef? enclosingType

Source

genMethodCall

static MethodDef genMethodCall(Compiler compiler, Loc loc, TypeDef parent, FuncType signature, CallExpr c, Bool firstAsTarget)

Source

This method overrides either call(List) or callx(A...) to push the args onto the stack, then redirect to the specified CallExpr c. We share this code for both closures and curries.

loc

Loc? loc

Source

make

new make(Compiler compiler)

Source

run

virtual override Void run()

Source

signature

FuncType? signature

Source