aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis/ReferencesResolver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/analysis/ReferencesResolver.cpp')
-rw-r--r--libsolidity/analysis/ReferencesResolver.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/libsolidity/analysis/ReferencesResolver.cpp b/libsolidity/analysis/ReferencesResolver.cpp
index a7b9e8b8..41cad922 100644
--- a/libsolidity/analysis/ReferencesResolver.cpp
+++ b/libsolidity/analysis/ReferencesResolver.cpp
@@ -83,6 +83,23 @@ void ReferencesResolver::endVisit(UserDefinedTypeName const& _typeName)
fatalTypeError(_typeName.location(), "Name has to refer to a struct, enum or contract.");
}
+void ReferencesResolver::endVisit(FunctionTypeName const& _typeName)
+{
+ switch (_typeName.visibility())
+ {
+ case VariableDeclaration::Visibility::Default:
+ case VariableDeclaration::Visibility::Internal:
+ case VariableDeclaration::Visibility::External:
+ break;
+ default:
+ typeError(_typeName.location(), "Invalid visibility, can only be \"external\" or \"internal\".");
+ }
+
+ // Do we allow storage references for external functions?
+
+ _typeName.annotation().type = make_shared<FunctionType>(_typeName);
+}
+
void ReferencesResolver::endVisit(Mapping const& _typeName)
{
TypePointer keyType = _typeName.keyType().annotation().type;