MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / preVisitBlockArgument

Method preVisitBlockArgument

src/ast/ast_lint.cpp:1140–1153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1138 }
1139 }
1140 virtual void preVisitBlockArgument ( ExprBlock * block, const VariablePtr & var, bool lastArg ) override {
1141 Visitor::preVisitBlockArgument(block, var, lastArg);
1142 if ( checkUnusedBlockArgument ) {
1143 if ( !var->marked_used && var->isAccessUnused() ) {
1144 program->error("unused block argument " + var->name, "",
1145 "use [unused_argument(" + var->name + ")] if intentional",
1146 var->at, CompilationError::invalid_block_argument);
1147 }
1148 }
1149 if ( var->type->getSizeOf64()>0x7fffffff ) {
1150 program->error("block argument variable " + var->name + " is too big", "", "",
1151 var->at,CompilationError::exceeds_argument);
1152 }
1153 }
1154 virtual void preVisit ( ExprMakeStruct * mks ) override {
1155 Visitor::preVisit(mks);
1156 if ( mks->constructor && mks->constructor->arguments.size() ) {

Callers

nothing calls this directly

Calls 3

isAccessUnusedMethod · 0.80
errorMethod · 0.45
getSizeOf64Method · 0.45

Tested by

no test coverage detected