aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
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 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\".");
}
}
}