| 70 | } |
| 71 | |
| 72 | VariableDeclaration const* rootConstVariableDeclaration(VariableDeclaration const& _varDecl) |
| 73 | { |
| 74 | solAssert(_varDecl.isConstant(), "Constant variable expected"); |
| 75 | solAssert(!isConstantVariableRecursive(_varDecl), "Recursive declaration"); |
| 76 | |
| 77 | VariableDeclaration const* rootDecl = &_varDecl; |
| 78 | Identifier const* identifier; |
| 79 | while ((identifier = dynamic_cast<Identifier const*>(rootDecl->value().get()))) |
| 80 | { |
| 81 | auto referencedVarDecl = dynamic_cast<VariableDeclaration const*>(identifier->annotation().referencedDeclaration); |
| 82 | if (!referencedVarDecl || !referencedVarDecl->isConstant()) |
| 83 | return nullptr; |
| 84 | rootDecl = referencedVarDecl; |
| 85 | } |
| 86 | return rootDecl; |
| 87 | } |
| 88 | |
| 89 | Expression const* resolveOuterUnaryTuples(Expression const* _expr) |
| 90 | { |
no test coverage detected