diff options
author | chriseth <chris@ethereum.org> | 2017-06-01 17:48:38 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-09-16 19:12:43 +0800 |
commit | 59ea19b3b957949fc53bfb5dc4e199d2196f8d18 (patch) | |
tree | 37f749081a21b2a0534131bc65e186e1d2228edf /libsolidity/analysis | |
parent | 2e72bd163a149183c119ca9664b98b0c5473da41 (diff) | |
download | dexon-solidity-59ea19b3b957949fc53bfb5dc4e199d2196f8d18.tar dexon-solidity-59ea19b3b957949fc53bfb5dc4e199d2196f8d18.tar.gz dexon-solidity-59ea19b3b957949fc53bfb5dc4e199d2196f8d18.tar.bz2 dexon-solidity-59ea19b3b957949fc53bfb5dc4e199d2196f8d18.tar.lz dexon-solidity-59ea19b3b957949fc53bfb5dc4e199d2196f8d18.tar.xz dexon-solidity-59ea19b3b957949fc53bfb5dc4e199d2196f8d18.tar.zst dexon-solidity-59ea19b3b957949fc53bfb5dc4e199d2196f8d18.zip |
Check for recursive structs.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 26529c22..fe4207a3 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -546,7 +546,7 @@ bool TypeChecker::visit(FunctionDefinition const& _function) if (!type(*var)->canLiveOutsideStorage()) 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 type is not allowed for public or external functions."); + m_errorReporter.fatalTypeError(var->location(), "Internal or recursive type is not allowed for public or external functions."); var->accept(*this); } @@ -641,7 +641,7 @@ bool TypeChecker::visit(VariableDeclaration const& _variable) _variable.visibility() >= VariableDeclaration::Visibility::Public && !FunctionType(_variable).interfaceFunctionType() ) - m_errorReporter.typeError(_variable.location(), "Internal type is not allowed for public state variables."); + m_errorReporter.typeError(_variable.location(), "Internal or recursive type is not allowed for public state variables."); if (varType->category() == Type::Category::Array) if (auto arrayType = dynamic_cast<ArrayType const*>(varType.get())) @@ -728,7 +728,7 @@ bool TypeChecker::visit(EventDefinition const& _eventDef) if (!type(*var)->canLiveOutsideStorage()) m_errorReporter.typeError(var->location(), "Type is required to live outside storage."); if (!type(*var)->interfaceType(false)) - m_errorReporter.typeError(var->location(), "Internal type is not allowed as event parameter type."); + m_errorReporter.typeError(var->location(), "Internal or recursive type is not allowed as event parameter type."); } if (_eventDef.isAnonymous() && numIndexed > 4) m_errorReporter.typeError(_eventDef.location(), "More than 4 indexed arguments for anonymous event."); |