aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2016-10-25 01:22:09 +0800
committerYoichi Hirai <i@yoichihirai.com>2016-10-25 01:31:57 +0800
commit59f6c18c2be86152261bb20732161c60fd2a6485 (patch)
treead04baea449a1a179c22da7bccd3c245b5acf0b8 /libsolidity
parent58477c233d5556a1b071ec347c1587420fd57412 (diff)
downloaddexon-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
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp5
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;
}