From 65d749b8d2be217a44877ff17864fd30ab7bf1cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Sat, 6 Feb 2021 15:36:43 +0100 Subject: [PATCH] FunctionType: Add assertions against missing type annotations - This should make it easier to realize that one of the analysis phases has not been executed. --- libsolidity/ast/Types.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index 182b2b72b..4cafc201c 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -2632,11 +2632,13 @@ FunctionType::FunctionType(FunctionDefinition const& _function, Kind _kind): for (ASTPointer const& var: _function.parameters()) { + solAssert(var->annotation().type, "Parameter type is not yet available in the AST."); m_parameterNames.push_back(var->name()); m_parameterTypes.push_back(var->annotation().type); } for (ASTPointer 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_returnParameterTypes.push_back(var->annotation().type); }