diff options
author | chriseth <chris@ethereum.org> | 2017-09-06 00:33:52 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-09-06 19:52:29 +0800 |
commit | b756274357c1e33517d535fdd2349a88221d4780 (patch) | |
tree | cbd1cbaaa93d1e45df651bd1030f0bc5965985ec /libsolidity | |
parent | 15bdc48a73d1cbebb9f75830fd1abbd29f798c12 (diff) | |
download | dexon-solidity-b756274357c1e33517d535fdd2349a88221d4780.tar.gz dexon-solidity-b756274357c1e33517d535fdd2349a88221d4780.tar.zst dexon-solidity-b756274357c1e33517d535fdd2349a88221d4780.zip |
Allow constant variables in pure functions.
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/analysis/ViewPureChecker.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libsolidity/analysis/ViewPureChecker.cpp b/libsolidity/analysis/ViewPureChecker.cpp index 6621edb1..d4a6e96f 100644 --- a/libsolidity/analysis/ViewPureChecker.cpp +++ b/libsolidity/analysis/ViewPureChecker.cpp @@ -179,7 +179,7 @@ void ViewPureChecker::endVisit(Identifier const& _identifier) bool writes = _identifier.annotation().lValueRequested; if (VariableDeclaration const* varDecl = dynamic_cast<VariableDeclaration const*>(declaration)) { - if (varDecl->isStateVariable()) + if (varDecl->isStateVariable() && !varDecl->isConstant()) mutability = writes ? StateMutability::NonPayable : StateMutability::View; } else if (MagicVariableDeclaration const* magicVar = dynamic_cast<MagicVariableDeclaration const*>(declaration)) |