diff options
-rw-r--r-- | libsolidity/codegen/ExpressionCompiler.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index da3e56cc..1cb74c06 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -888,6 +888,18 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess) { // no-op } + else if (auto variable = dynamic_cast<VariableDeclaration const*>(_memberAccess.annotation().referencedDeclaration)) + { + // TODO duplicate code should be unified + + if (!variable->isConstant()) + setLValueFromDeclaration(*_memberAccess.annotation().referencedDeclaration, _memberAccess); + else + { + variable->value()->accept(*this); + utils().convertType(*variable->value()->annotation().type, *variable->annotation().type); + } + } else _memberAccess.expression().accept(*this); } |