mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
FunctionType: Add assertions against missing type annotations
- This should make it easier to realize that one of the analysis phases has not been executed.
This commit is contained in:
parent
8bacf03ffe
commit
13a9d21d88
@ -2632,11 +2632,13 @@ FunctionType::FunctionType(FunctionDefinition const& _function, Kind _kind):
|
|||||||
|
|
||||||
for (ASTPointer<VariableDeclaration> const& var: _function.parameters())
|
for (ASTPointer<VariableDeclaration> const& var: _function.parameters())
|
||||||
{
|
{
|
||||||
|
solAssert(var->annotation().type, "Parameter type is not yet available in the AST.");
|
||||||
m_parameterNames.push_back(var->name());
|
m_parameterNames.push_back(var->name());
|
||||||
m_parameterTypes.push_back(var->annotation().type);
|
m_parameterTypes.push_back(var->annotation().type);
|
||||||
}
|
}
|
||||||
for (ASTPointer<VariableDeclaration> const& var: _function.returnParameters())
|
for (ASTPointer<VariableDeclaration> const& var: _function.returnParameters())
|
||||||
{
|
{
|
||||||
|
solAssert(var->annotation().type, "Return parameter type is not yet available in the AST.");
|
||||||
m_returnParameterNames.push_back(var->name());
|
m_returnParameterNames.push_back(var->name());
|
||||||
m_returnParameterTypes.push_back(var->annotation().type);
|
m_returnParameterTypes.push_back(var->annotation().type);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user