diff options
author | chriseth <chris@ethereum.org> | 2017-09-18 22:38:55 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-18 22:38:55 +0800 |
commit | 3a9a9db6d688f3a1ef3bbcb0a378bbd14779abde (patch) | |
tree | 736d85c93db1af500f61d9357198372c15c76744 /libsolidity | |
parent | 068a593d9c7ab31d1048199d262da3702f188bd3 (diff) | |
parent | a3380ea8d0e02da1eb68eb15906015faf4e8bc3c (diff) | |
download | dexon-solidity-3a9a9db6d688f3a1ef3bbcb0a378bbd14779abde.tar.gz dexon-solidity-3a9a9db6d688f3a1ef3bbcb0a378bbd14779abde.tar.zst dexon-solidity-3a9a9db6d688f3a1ef3bbcb0a378bbd14779abde.zip |
Merge pull request #2910 from ethereum/fallback-restrict-external
Force fallback to be external (experimental 0.5.0 change)
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index fe4207a3..030c8f6b 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -120,6 +120,11 @@ bool TypeChecker::visit(ContractDefinition const& _contract) m_errorReporter.typeError(fallbackFunction->parameterList().location(), "Fallback function cannot take parameters."); if (!fallbackFunction->returnParameters().empty()) m_errorReporter.typeError(fallbackFunction->returnParameterList()->location(), "Fallback function cannot return values."); + if ( + _contract.sourceUnit().annotation().experimentalFeatures.count(ExperimentalFeature::V050) && + fallbackFunction->visibility() != FunctionDefinition::Visibility::External + ) + m_errorReporter.typeError(fallbackFunction->location(), "Fallback function must be defined as \"external\"."); } } } |