aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/ReferencesResolver.cpp11
-rw-r--r--libsolidity/analysis/SyntaxChecker.cpp10
2 files changed, 11 insertions, 10 deletions
diff --git a/libsolidity/analysis/ReferencesResolver.cpp b/libsolidity/analysis/ReferencesResolver.cpp
index dfcbf888..a9a998b0 100644
--- a/libsolidity/analysis/ReferencesResolver.cpp
+++ b/libsolidity/analysis/ReferencesResolver.cpp
@@ -144,7 +144,7 @@ void ReferencesResolver::endVisit(UserDefinedTypeName const& _typeName)
Declaration const* declaration = m_resolver.pathFromCurrentScope(_typeName.namePath());
if (!declaration)
{
- declarationError(_typeName.location(), "Identifier not found or not unique.");
+ fatalDeclarationError(_typeName.location(), "Identifier not found or not unique.");
return;
}
@@ -404,9 +404,16 @@ void ReferencesResolver::endVisit(VariableDeclaration const& _variable)
}
isPointer = !_variable.isStateVariable();
}
-
type = ref->copyForLocation(typeLoc, isPointer);
}
+ else if (dynamic_cast<MappingType const*>(type.get()))
+ {
+ if (_variable.isLocalVariable() && varLoc != Location::Storage)
+ typeError(
+ _variable.location(),
+ "Data location for mappings must be specified as \"storage\"."
+ );
+ }
else if (varLoc != Location::Default && !ref)
typeError(_variable.location(), "Data location can only be given for array or struct types.");
diff --git a/libsolidity/analysis/SyntaxChecker.cpp b/libsolidity/analysis/SyntaxChecker.cpp
index 5d16a33f..77492499 100644
--- a/libsolidity/analysis/SyntaxChecker.cpp
+++ b/libsolidity/analysis/SyntaxChecker.cpp
@@ -213,8 +213,6 @@ bool SyntaxChecker::visit(ContractDefinition const& _contract)
bool SyntaxChecker::visit(FunctionDefinition const& _function)
{
- bool const v050 = m_sourceUnit->annotation().experimentalFeatures.count(ExperimentalFeature::V050);
-
if (_function.noVisibilitySpecified())
{
string suggestedVisibility = _function.isFallback() || m_isInterface ? "external" : "public";
@@ -225,12 +223,8 @@ bool SyntaxChecker::visit(FunctionDefinition const& _function)
}
if (!_function.isImplemented() && !_function.modifiers().empty())
- {
- if (v050)
- m_errorReporter.syntaxError(_function.location(), "Functions without implementation cannot have modifiers.");
- else
- m_errorReporter.warning(_function.location(), "Modifiers of functions without implementation are ignored." );
- }
+ m_errorReporter.syntaxError(_function.location(), "Functions without implementation cannot have modifiers.");
+
return true;
}