class compiler::MethodDef

sys::Obj
  compiler::Node
    compiler::DefNode
      compiler::SlotDef
        compiler::MethodDef : compiler::CMethod

Source

MethodDef models a method definition - it's signature and body.

accessorFor

FieldDef? accessorFor

Source

addLocalVar

MethodVar addLocalVar(CType ctype, Str? name, Block? scope)

Source

Make and add a MethodVar for a local variable. If name is null then we auto-generate a temporary variable name

addLocalVarForDef

MethodVar addLocalVarForDef(LocalDefStmt def, Block? scope)

Source

Make and add a MethodVar for a local variable.

addParamVar

MethodVar addParamVar(CType ctype, Str name)

Source

Add a parameter to the end of the method signature and initialize the param MethodVar. Note: currently this only works if no locals are defined.

code

Block? code

Source

ctorChain

CallExpr? ctorChain

Source

getOrAddShadowVar

MethodVar getOrAddShadowVar(MethodVar binding, Block? scope)

Source

Get or create a shadow variable in this closure method to shadow a variable from an outer scope

inheritedRet

CType? inheritedRet

Source

inheritedReturns

virtual override CType inheritedReturns()

Source

isFieldAccessor

Bool isFieldAccessor()

Source

Return if getter/setter for FieldDef

isFieldSetter

Bool isFieldSetter()

Source

Return if setter for FieldDef

isInstanceInit

Bool isInstanceInit()

Source

Return if this a instance initializer block.

isItBlockCtor

Bool isItBlockCtor()

Source

Return if this is a constructor with an it-block as last parameter

isNameInstanceInit

static Bool isNameInstanceInit(Str name)

Source

isNameStaticInit

static Bool isNameStaticInit(Str name)

Source

isStaticInit

Bool isStaticInit()

Source

Return if this a static initializer block.

make

new make(Loc loc, TypeDef parent, Str name := "?", Int flags := 0)

Source

makeInstanceInit

static MethodDef makeInstanceInit(Loc loc, TypeDef parent, Block? block)

Source

makeStaticInit

static MethodDef makeStaticInit(Loc loc, TypeDef parent, Block? block)

Source

paramDefs

ParamDef[] paramDefs

Source

params

virtual override CParam[] params()

Source

print

virtual override Void print(AstWriter out)

Source

ret

@Deprecated
CType ret

Source

returns

virtual override CType returns

Source

signature

virtual override Str signature()

Source

transpileTempVar

Str transpileTempVar()

Source

Generate unique varaible name for transpiler. This name is not mapped into Fantom as local var like addLocalVar.

usesCvars

Bool usesCvars

Source

vars

MethodVar[] vars

Source

walk

virtual override Void walk(Visitor v, VisitDepth depth)

Source