fixed assert on EI creation for structs containing only mapping or arrays

This commit is contained in:
LianaHus
2016-01-15 17:36:06 +01:00
parent ca45cfee8c
commit b2daa5a9d8
3 changed files with 25 additions and 6 deletions
+8 -6
View File
@@ -292,17 +292,19 @@ void TypeChecker::checkContractExternalTypeClashes(ContractDefinition const& _co
if (f->isPartOfExternalInterface())
{
auto functionType = make_shared<FunctionType>(*f);
externalDeclarations[functionType->externalSignature()].push_back(
make_pair(f, functionType)
);
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)
);
if (functionType->interfaceFunctionType())
externalDeclarations[functionType->externalSignature()].push_back(
make_pair(v, functionType)
);
}
}
for (auto const& it: externalDeclarations)
+4
View File
@@ -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);
}