mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
codegen: if a member access has been resolved as a variable, follow that
This fixes at least the first example in #988
This commit is contained in:
parent
47b11ef2b8
commit
acba7b92e5
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user