mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
style fixes
This commit is contained in:
parent
4227be6e12
commit
37a0234c4a
2
AST.cpp
2
AST.cpp
@ -337,7 +337,7 @@ void FunctionDefinition::checkTypeRequirements()
|
|||||||
{
|
{
|
||||||
if (!var->getType()->canLiveOutsideStorage())
|
if (!var->getType()->canLiveOutsideStorage())
|
||||||
BOOST_THROW_EXCEPTION(var->createTypeError("Type is required to live outside storage."));
|
BOOST_THROW_EXCEPTION(var->createTypeError("Type is required to live outside storage."));
|
||||||
if (!(var->getType()->externalType()) && getVisibility() >= Visibility::Public)
|
if (getVisibility() >= Visibility::Public && !(var->getType()->externalType()))
|
||||||
BOOST_THROW_EXCEPTION(var->createTypeError("Internal type is not allowed for function with external visibility"));
|
BOOST_THROW_EXCEPTION(var->createTypeError("Internal type is not allowed for function with external visibility"));
|
||||||
}
|
}
|
||||||
for (ASTPointer<ModifierInvocation> const& modifier: m_functionModifiers)
|
for (ASTPointer<ModifierInvocation> const& modifier: m_functionModifiers)
|
||||||
|
15
Types.cpp
15
Types.cpp
@ -1103,11 +1103,16 @@ TypePointer FunctionType::externalType() const
|
|||||||
TypePointers paramTypes;
|
TypePointers paramTypes;
|
||||||
TypePointers retParamTypes;
|
TypePointers retParamTypes;
|
||||||
|
|
||||||
for (auto it = m_parameterTypes.cbegin(); it != m_parameterTypes.cend(); ++it)
|
for(auto type: m_parameterTypes)
|
||||||
paramTypes.push_back((*it)->externalType());
|
{
|
||||||
for (auto it = m_returnParameterTypes.cbegin(); it != m_returnParameterTypes.cend(); ++it)
|
solAssert(!!type->externalType(), "To be included in external type of the function, the argument should have external type.");
|
||||||
retParamTypes.push_back((*it)->externalType());
|
paramTypes.push_back(type->externalType());
|
||||||
|
}
|
||||||
|
for(auto param: m_returnParameterTypes)
|
||||||
|
{
|
||||||
|
solAssert(!!param->externalType(), "To be included in external type of the function, the argument should have external type.");
|
||||||
|
retParamTypes.push_back(param->externalType());
|
||||||
|
}
|
||||||
return make_shared<FunctionType>(paramTypes, retParamTypes, m_location, m_arbitraryParameters);
|
return make_shared<FunctionType>(paramTypes, retParamTypes, m_location, m_arbitraryParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user