| 717 | } |
| 718 | |
| 719 | bool 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 | |
| 738 | bool VariableDeclaration::isLocalOrReturn() const |
| 739 | { |
no test coverage detected