class compiler::MethodDef
sys::Obj compiler::Node compiler::DefNode compiler::SlotDef compiler::MethodDef : compiler::CMethod
MethodDef models a method definition - it's signature and body.
- accessorFor
-
FieldDef? accessorFor - addLocalVar
-
MethodVar addLocalVar(CType ctype, Str? name, Block? scope)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)Make and add a MethodVar for a local variable.
- addParamVar
-
MethodVar addParamVar(CType ctype, Str name)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 - ctorChain
-
CallExpr? ctorChain - getOrAddShadowVar
-
MethodVar getOrAddShadowVar(MethodVar binding, Block? scope)Get or create a shadow variable in this closure method to shadow a variable from an outer scope
- inheritedRet
-
CType? inheritedRet - inheritedReturns
-
virtual override CType inheritedReturns() - isFieldAccessor
-
Bool isFieldAccessor()Return if getter/setter for FieldDef
- isFieldSetter
-
Bool isFieldSetter()Return if setter for FieldDef
- isInstanceInit
-
Bool isInstanceInit()Return if this a instance initializer block.
- isItBlockCtor
-
Bool isItBlockCtor()Return if this is a constructor with an it-block as last parameter
- isNameInstanceInit
- isNameStaticInit
- isStaticInit
-
Bool isStaticInit()Return if this a static initializer block.
- make
-
new make(Loc loc, TypeDef parent, Str name := "?", Int flags := 0) - makeInstanceInit
-
static MethodDef makeInstanceInit(Loc loc, TypeDef parent, Block? block) - makeStaticInit
-
static MethodDef makeStaticInit(Loc loc, TypeDef parent, Block? block) - paramDefs
-
ParamDef[] paramDefs - params
-
virtual override CParam[] params() - ret
-
@Deprecated
CType ret - returns
-
virtual override CType returns - signature
-
virtual override Str signature() - transpileTempVar
-
Str transpileTempVar()Generate unique varaible name for transpiler. This name is not mapped into Fantom as local var like addLocalVar.
- usesCvars
-
Bool usesCvars - vars
-
MethodVar[] vars - walk
-
virtual override Void walk(Visitor v, VisitDepth depth)