aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-09-16 23:10:23 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-09-18 18:58:37 +0800
commita3380ea8d0e02da1eb68eb15906015faf4e8bc3c (patch)
tree6e1024d4f7ad80a5f46a3b1ee471183146e3f82c /libsolidity
parentc289fd3d9eded048f229add7f6c7f1cfd201b32d (diff)
downloaddexon-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')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp5
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\".");
}
}
}