diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2016-08-27 03:01:47 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2016-09-06 18:40:00 +0800 |
commit | 6ec40b3cdeca667cea2222755c6e145c72279b1d (patch) | |
tree | 090d1e61bf3d1f8807c0261ac05a441b8710587e /libsolidity/analysis/TypeChecker.cpp | |
parent | f687635e4743a1e12d01fb082a4f8a76a759ab48 (diff) | |
download | dexon-solidity-6ec40b3cdeca667cea2222755c6e145c72279b1d.tar dexon-solidity-6ec40b3cdeca667cea2222755c6e145c72279b1d.tar.gz dexon-solidity-6ec40b3cdeca667cea2222755c6e145c72279b1d.tar.bz2 dexon-solidity-6ec40b3cdeca667cea2222755c6e145c72279b1d.tar.lz dexon-solidity-6ec40b3cdeca667cea2222755c6e145c72279b1d.tar.xz dexon-solidity-6ec40b3cdeca667cea2222755c6e145c72279b1d.tar.zst dexon-solidity-6ec40b3cdeca667cea2222755c6e145c72279b1d.zip |
Reject constant modifier on the fallback function
Diffstat (limited to 'libsolidity/analysis/TypeChecker.cpp')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 06e26a76..fc1b1f59 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -94,6 +94,8 @@ bool TypeChecker::visit(ContractDefinition const& _contract) fallbackFunction = function; if (_contract.isLibrary()) typeError(fallbackFunction->location(), "Libraries cannot have fallback functions."); + if (fallbackFunction->isDeclaredConst()) + typeError(fallbackFunction->location(), "Fallback function cannot be declared constant."); if (!fallbackFunction->parameters().empty()) typeError(fallbackFunction->parameterList().location(), "Fallback function cannot take parameters."); if (!fallbackFunction->returnParameters().empty()) |