diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2016-10-25 01:22:09 +0800 |
---|---|---|
committer | Yoichi Hirai <i@yoichihirai.com> | 2016-10-25 01:31:57 +0800 |
commit | 59f6c18c2be86152261bb20732161c60fd2a6485 (patch) | |
tree | ad04baea449a1a179c22da7bccd3c245b5acf0b8 | |
parent | 58477c233d5556a1b071ec347c1587420fd57412 (diff) | |
download | dexon-solidity-59f6c18c2be86152261bb20732161c60fd2a6485.tar.gz dexon-solidity-59f6c18c2be86152261bb20732161c60fd2a6485.tar.zst dexon-solidity-59f6c18c2be86152261bb20732161c60fd2a6485.zip |
analysis: determine if a member access on a contract is an l-value
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index b5955c8f..f871e3a1 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -1376,6 +1376,11 @@ bool TypeChecker::visit(MemberAccess const& _memberAccess) } else if (exprType->category() == Type::Category::FixedBytes) annotation.isLValue = false; + else if (TypeType const* typeType = dynamic_cast<decltype(typeType)>(exprType.get())) + { + if (ContractType const* contractType = dynamic_cast<decltype(contractType)>(typeType->actualType().get())) + annotation.isLValue = annotation.referencedDeclaration->isLValue(); + } return false; } |