mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
analysis: avoid emscripten build failure
This commit is contained in:
parent
91d4e8e0ba
commit
0216f34010
@ -264,11 +264,11 @@ vector<Declaration const*> NameAndTypeResolver::cleanedDeclarations(
|
|||||||
solAssert(dynamic_cast<FunctionDefinition const*>(*it) || dynamic_cast<VariableDeclaration const*>(*it),
|
solAssert(dynamic_cast<FunctionDefinition const*>(*it) || dynamic_cast<VariableDeclaration const*>(*it),
|
||||||
"Found overloading involving something not a function or a variable");
|
"Found overloading involving something not a function or a variable");
|
||||||
|
|
||||||
shared_ptr<FunctionType const> functionType {};
|
unique_ptr<FunctionType const> functionType {};
|
||||||
|
|
||||||
if (FunctionDefinition const* functionDefinition = dynamic_cast<FunctionDefinition const*>(*it))
|
if (FunctionDefinition const* functionDefinition = dynamic_cast<FunctionDefinition const*>(*it))
|
||||||
{
|
{
|
||||||
functionType = make_shared<FunctionType const>(*functionDefinition);
|
functionType = unique_ptr<FunctionType const>(new FunctionType(*functionDefinition));
|
||||||
for (auto parameter: functionType->parameterTypes() + functionType->returnParameterTypes())
|
for (auto parameter: functionType->parameterTypes() + functionType->returnParameterTypes())
|
||||||
if (!parameter)
|
if (!parameter)
|
||||||
reportFatalDeclarationError(_identifier.location(), "Function type can not be used in this context");
|
reportFatalDeclarationError(_identifier.location(), "Function type can not be used in this context");
|
||||||
@ -276,7 +276,7 @@ vector<Declaration const*> NameAndTypeResolver::cleanedDeclarations(
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
VariableDeclaration const* variableDeclaration = dynamic_cast<VariableDeclaration const*>(*it);
|
VariableDeclaration const* variableDeclaration = dynamic_cast<VariableDeclaration const*>(*it);
|
||||||
functionType = make_shared<FunctionType const>(*variableDeclaration);
|
functionType = unique_ptr<FunctionType const>(new FunctionType(*variableDeclaration));
|
||||||
}
|
}
|
||||||
solAssert(functionType, "failed to determine the function type of the overloaded");
|
solAssert(functionType, "failed to determine the function type of the overloaded");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user