aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-09-06 16:58:56 +0800
committerchriseth <c@ethdev.com>2016-09-06 16:58:56 +0800
commit384f189a6adffa7b1879bb06ded4453ef5f00dcb (patch)
treed3a57bda669a8f693d86342af8dcdfd8c6dddd28 /libsolidity/analysis
parentff11aa192708620de538ed8676136eb616abc74e (diff)
downloaddexon-solidity-384f189a6adffa7b1879bb06ded4453ef5f00dcb.tar
dexon-solidity-384f189a6adffa7b1879bb06ded4453ef5f00dcb.tar.gz
dexon-solidity-384f189a6adffa7b1879bb06ded4453ef5f00dcb.tar.bz2
dexon-solidity-384f189a6adffa7b1879bb06ded4453ef5f00dcb.tar.lz
dexon-solidity-384f189a6adffa7b1879bb06ded4453ef5f00dcb.tar.xz
dexon-solidity-384f189a6adffa7b1879bb06ded4453ef5f00dcb.tar.zst
dexon-solidity-384f189a6adffa7b1879bb06ded4453ef5f00dcb.zip
Tests for payable / private combination.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index eea4619d..06e26a76 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -423,9 +423,9 @@ bool TypeChecker::visit(FunctionDefinition const& _function)
typeError(_function.location(), "Library functions cannot be payable.");
if (!_function.isConstructor() && !_function.name().empty() && !_function.isPartOfExternalInterface())
typeError(_function.location(), "Internal functions cannot be payable.");
+ if (_function.isDeclaredConst())
+ typeError(_function.location(), "Functions cannot be constant and payable at the same time.");
}
- if (_function.isPayable() && _function.isDeclaredConst())
- typeError(_function.location(), "Functions cannot be constant and payable at the same time.");
for (ASTPointer<VariableDeclaration> const& var: _function.parameters() + _function.returnParameters())
{
if (!type(*var)->canLiveOutsideStorage())