diff options
author | Liana Husikyan <liana@ethdev.com> | 2015-04-01 21:57:39 +0800 |
---|---|---|
committer | Liana Husikyan <liana@ethdev.com> | 2015-04-01 21:57:39 +0800 |
commit | 8e19eea7d5d6cd4bffa03f8617023a74268de608 (patch) | |
tree | c3258fe54712d5cdc6462156fc5a3fe0bec43721 /AST.cpp | |
parent | eac47b13280f7edf2431f25d61d5dc1c3425f206 (diff) | |
download | dexon-solidity-8e19eea7d5d6cd4bffa03f8617023a74268de608.tar.gz dexon-solidity-8e19eea7d5d6cd4bffa03f8617023a74268de608.tar.zst dexon-solidity-8e19eea7d5d6cd4bffa03f8617023a74268de608.zip |
VariableDeclaration::checkTypeRequirements() refactoring
Diffstat (limited to 'AST.cpp')
-rw-r--r-- | AST.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -386,11 +386,8 @@ void VariableDeclaration::checkTypeRequirements() if (m_isStateVariable && !m_type->externalType() && getVisibility() >= Visibility::Public) BOOST_THROW_EXCEPTION(createTypeError("Internal type is not allowed for state variables.")); - auto sharedToExternalTypes = FunctionType(*this).externalType(); // do not destroy the shared pointer. - auto externalFunctionTypes = dynamic_cast<FunctionType const*>(sharedToExternalTypes.get()); - for (auto parameter: externalFunctionTypes->getParameterTypes() + externalFunctionTypes->getReturnParameterTypes()) - if (!parameter || !(parameter->externalType())) - BOOST_THROW_EXCEPTION(createTypeError("Internal type is not allowed for public state variables.")); + if (!FunctionType(*this).externalType()) + BOOST_THROW_EXCEPTION(createTypeError("Internal type is not allowed for public state variables.")); } else { |