diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-09-16 23:10:23 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-09-18 18:58:37 +0800 |
commit | a3380ea8d0e02da1eb68eb15906015faf4e8bc3c (patch) | |
tree | 6e1024d4f7ad80a5f46a3b1ee471183146e3f82c /libsolidity/analysis | |
parent | c289fd3d9eded048f229add7f6c7f1cfd201b32d (diff) | |
download | dexon-solidity-a3380ea8d0e02da1eb68eb15906015faf4e8bc3c.tar.gz dexon-solidity-a3380ea8d0e02da1eb68eb15906015faf4e8bc3c.tar.zst dexon-solidity-a3380ea8d0e02da1eb68eb15906015faf4e8bc3c.zip |
Force fallback to be external (experimental 0.5.0 change)
Diffstat (limited to 'libsolidity/analysis')
-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 26529c22..529a4f8d 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\"."); } } } |