diff options
Make fallback function throw by default.
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 235fcabd..bc03da01 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -92,6 +92,8 @@ bool TypeChecker::visit(ContractDefinition const& _contract) else { fallbackFunction = function; + if (_contract.isLibrary()) + typeError(fallbackFunction->location(), "Libraries cannot have fallback functions."); if (!fallbackFunction->parameters().empty()) typeError(fallbackFunction->parameterList().location(), "Fallback function cannot take parameters."); if (!fallbackFunction->returnParameters().empty()) |