aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-08-10 21:13:12 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-08-13 20:31:10 +0800
commit57ada1d69e311f847b4581a0e487aebd1b0e468f (patch)
tree653920cb378e2a7ac1a97ea3b022c106c599a197 /libsolidity/analysis
parenta2c754b3fed422b3d8027a5298624bcfed3744a5 (diff)
downloaddexon-solidity-57ada1d69e311f847b4581a0e487aebd1b0e468f.tar.gz
dexon-solidity-57ada1d69e311f847b4581a0e487aebd1b0e468f.tar.zst
dexon-solidity-57ada1d69e311f847b4581a0e487aebd1b0e468f.zip
Allow mapping arguments and return values in internal library functions.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index bcc3757a..62216272 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -629,7 +629,14 @@ bool TypeChecker::visit(FunctionDefinition const& _function)
}
for (ASTPointer<VariableDeclaration> const& var: _function.parameters() + _function.returnParameters())
{
- if (!type(*var)->canLiveOutsideStorage())
+ if (
+ !type(*var)->canLiveOutsideStorage() &&
+ !(
+ isLibraryFunction &&
+ (_function.visibility() <= FunctionDefinition::Visibility::Internal) &&
+ type(*var)->category() == Type::Category::Mapping
+ )
+ )
m_errorReporter.typeError(var->location(), "Type is required to live outside storage.");
if (_function.visibility() >= FunctionDefinition::Visibility::Public && !(type(*var)->interfaceType(isLibraryFunction)))
m_errorReporter.fatalTypeError(var->location(), "Internal or recursive type is not allowed for public or external functions.");