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 - inheritedRet
-
CType? inheritedRet - inheritedReturnType
-
virtual override CType inheritedReturnType() - 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
- isOnce
-
Bool isOnce()Return if this is a once method
- isStaticInit
-
Bool isStaticInit()Return if this a static initializer block.
- make
-
new make(Loc loc, TypeDef parent, Str name := "?", Int flags := 0) - makeInstanceInit
-
const static MethodDef makeInstanceInit(Loc loc, TypeDef parent, Block? block) - makeStaticInit
-
const static MethodDef makeStaticInit(Loc loc, TypeDef parent, Block? block) - paramDefs
-
ParamDef[] paramDefs - params
-
virtual override CParam[] params() - ret
-
CType ret - returnType
-
virtual override CType returnType() - signature
-
virtual override Str signature() - usesCvars
-
Bool usesCvars - vars
-
MethodVar[] vars - walk
-
virtual override Void walk(Visitor v, VisitDepth depth)