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.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/libsolidity/analysis/ReferencesResolver.cpp b/libsolidity/analysis/ReferencesResolver.cpp
index c49af013..a0768a34 100644
--- a/libsolidity/analysis/ReferencesResolver.cpp
+++ b/libsolidity/analysis/ReferencesResolver.cpp
@@ -96,7 +96,14 @@ void ReferencesResolver::endVisit(FunctionTypeName const& _typeName)
}
if (_typeName.isPayable() && _typeName.visibility() != VariableDeclaration::Visibility::External)
- fatalTypeError(_typeName.location(), "Only external function types can be payable.");
+ fatalTypeError(_typeName.location(), "Only external function types can be payable.");
+ if (_typeName.visibility() == VariableDeclaration::Visibility::External)
+ for (auto const& t: _typeName.parameterTypes() + _typeName.returnParameterTypes())
+ {
+ solAssert(t->annotation().type, "Type not set for parameter.");
+ if (!t->annotation().type->canBeUsedExternally(false))
+ fatalTypeError(t->location(), "Internal type cannot be used for external function type.");
+ }
_typeName.annotation().type = make_shared<FunctionType>(_typeName);
}