aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2017-03-02 02:49:15 +0800
committerchriseth <c@ethdev.com>2017-03-13 20:30:23 +0800
commit14948e514d7b15eb92d2c08f018bb23ead71fa5a (patch)
treeb1a1e3c3f3d65b1254ccfd5d073f393fab84c7c9 /libsolidity
parent49cfacced291ea73d99ec1353a0c77bfe476729a (diff)
downloaddexon-solidity-14948e514d7b15eb92d2c08f018bb23ead71fa5a.tar.gz
dexon-solidity-14948e514d7b15eb92d2c08f018bb23ead71fa5a.tar.zst
dexon-solidity-14948e514d7b15eb92d2c08f018bb23ead71fa5a.zip
Allow enum values for constants.
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index 38da9b14..75530739 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -1466,7 +1466,10 @@ bool TypeChecker::visit(MemberAccess const& _memberAccess)
}
// TODO some members might be pure, but for example `address(0x123).balance` is not pure
- // although every subexpression is, so leaving this to false for now.
+ // although every subexpression is, so leaving this limited for now.
+ if (auto tt = dynamic_cast<TypeType const*>(exprType.get()))
+ if (tt->actualType()->category() == Type::Category::Enum)
+ annotation.isPure = true;
return false;
}