diff options
author | chriseth <c@ethdev.com> | 2017-03-02 02:49:15 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2017-03-13 20:30:23 +0800 |
commit | 14948e514d7b15eb92d2c08f018bb23ead71fa5a (patch) | |
tree | b1a1e3c3f3d65b1254ccfd5d073f393fab84c7c9 /libsolidity | |
parent | 49cfacced291ea73d99ec1353a0c77bfe476729a (diff) | |
download | dexon-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.cpp | 5 |
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; } |