mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #359 from LianaHus/sol_only_one_array_as_state_var
fixed ICError when creating EI for structs containing only mapping or arrays
This commit is contained in:
@@ -292,17 +292,21 @@ void TypeChecker::checkContractExternalTypeClashes(ContractDefinition const& _co
|
||||
if (f->isPartOfExternalInterface())
|
||||
{
|
||||
auto functionType = make_shared<FunctionType>(*f);
|
||||
externalDeclarations[functionType->externalSignature()].push_back(
|
||||
make_pair(f, functionType)
|
||||
);
|
||||
// under non error circumstances this should be true
|
||||
if (functionType->interfaceFunctionType())
|
||||
externalDeclarations[functionType->externalSignature()].push_back(
|
||||
make_pair(f, functionType)
|
||||
);
|
||||
}
|
||||
for (VariableDeclaration const* v: contract->stateVariables())
|
||||
if (v->isPartOfExternalInterface())
|
||||
{
|
||||
auto functionType = make_shared<FunctionType>(*v);
|
||||
externalDeclarations[functionType->externalSignature()].push_back(
|
||||
make_pair(v, functionType)
|
||||
);
|
||||
// under non error circumstances this should be true
|
||||
if (functionType->interfaceFunctionType())
|
||||
externalDeclarations[functionType->externalSignature()].push_back(
|
||||
make_pair(v, functionType)
|
||||
);
|
||||
}
|
||||
}
|
||||
for (auto const& it: externalDeclarations)
|
||||
|
||||
@@ -1593,6 +1593,10 @@ FunctionTypePointer FunctionType::interfaceFunctionType() const
|
||||
else
|
||||
return FunctionTypePointer();
|
||||
}
|
||||
auto variable = dynamic_cast<VariableDeclaration const*>(m_declaration);
|
||||
if (variable && retParamTypes.empty())
|
||||
return FunctionTypePointer();
|
||||
|
||||
return make_shared<FunctionType>(paramTypes, retParamTypes, m_parameterNames, m_returnParameterNames, m_location, m_arbitraryParameters);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user