MCPcopy Create free account
hub / github.com/argotorg/solidity / isCallableOrCatchParameter

Method isCallableOrCatchParameter

libsolidity/ast/AST.cpp:719–736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

717}
718
719bool VariableDeclaration::isCallableOrCatchParameter() const
720{
721 if (isReturnParameter() || isTryCatchParameter())
722 return true;
723
724 std::vector<ASTPointer<VariableDeclaration>> const* parameters = nullptr;
725
726 if (auto const* funTypeName = dynamic_cast<FunctionTypeName const*>(scope()))
727 parameters = &funTypeName->parameterTypes();
728 else if (auto const* callable = dynamic_cast<CallableDeclaration const*>(scope()))
729 parameters = &callable->parameters();
730
731 if (parameters)
732 for (auto const& variable: *parameters)
733 if (variable.get() == this)
734 return true;
735 return false;
736}
737
738bool VariableDeclaration::isLocalOrReturn() const
739{

Callers 4

endVisitMethod · 0.80
endVisitMethod · 0.80
visitMethod · 0.80
visitMethod · 0.80

Calls 3

parameterTypesMethod · 0.80
parametersMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected