mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
VariableDeclaration::checkTypeRequirements() refactoring
This commit is contained in:
parent
eac47b1328
commit
8e19eea7d5
7
AST.cpp
7
AST.cpp
@ -386,11 +386,8 @@ void VariableDeclaration::checkTypeRequirements()
|
|||||||
if (m_isStateVariable && !m_type->externalType() && getVisibility() >= Visibility::Public)
|
if (m_isStateVariable && !m_type->externalType() && getVisibility() >= Visibility::Public)
|
||||||
BOOST_THROW_EXCEPTION(createTypeError("Internal type is not allowed for state variables."));
|
BOOST_THROW_EXCEPTION(createTypeError("Internal type is not allowed for state variables."));
|
||||||
|
|
||||||
auto sharedToExternalTypes = FunctionType(*this).externalType(); // do not destroy the shared pointer.
|
if (!FunctionType(*this).externalType())
|
||||||
auto externalFunctionTypes = dynamic_cast<FunctionType const*>(sharedToExternalTypes.get());
|
BOOST_THROW_EXCEPTION(createTypeError("Internal type is not allowed for public state variables."));
|
||||||
for (auto parameter: externalFunctionTypes->getParameterTypes() + externalFunctionTypes->getReturnParameterTypes())
|
|
||||||
if (!parameter || !(parameter->externalType()))
|
|
||||||
BOOST_THROW_EXCEPTION(createTypeError("Internal type is not allowed for public state variables."));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user