Adjust code to review findings

This commit is contained in:
wechman
2022-09-28 13:06:25 +02:00
parent 1084a34f28
commit a8bf1f255d
5 changed files with 52 additions and 30 deletions
+6 -3
View File
@@ -61,6 +61,8 @@ bool ControlFlowBuilder::visit(BinaryOperation const& _operation)
switch (_operation.getOperator())
{
case Token::Conditional:
return true;
case Token::Or:
case Token::And:
{
@@ -71,7 +73,6 @@ bool ControlFlowBuilder::visit(BinaryOperation const& _operation)
auto nodes = splitFlow<2>();
nodes[0] = createFlow(nodes[0], _operation.rightExpression());
mergeFlow(nodes, nodes[1]);
return false;
}
default:
@@ -79,15 +80,17 @@ bool ControlFlowBuilder::visit(BinaryOperation const& _operation)
if (_operation.annotation().userDefinedFunction)
{
visitNode(_operation);
_operation.leftExpression().accept(*this);
_operation.rightExpression().accept(*this);
solAssert(!m_currentNode->resolveFunctionCall(nullptr));
m_currentNode->functionCall = _operation.annotation().userDefinedFunction;
auto nextNode = newLabel();
connect(m_currentNode, nextNode);
m_currentNode = nextNode;
}
return true;
return false;
}
}
}
+2 -1
View File
@@ -3931,7 +3931,8 @@ void TypeChecker::endVisit(UsingForDirective const& _usingFor)
"."
);
else if (
!TokenTraits::isBinaryOp(*operator_) && TokenTraits::isUnaryOp(*operator_) &&
!TokenTraits::isBinaryOp(*operator_) &&
TokenTraits::isUnaryOp(*operator_) &&
functionType->parameterTypesIncludingSelf().size() != 1
)
m_errorReporter.typeError(