aboutsummaryrefslogtreecommitdiffstats
path: root/AST.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'AST.cpp')
-rw-r--r--AST.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/AST.cpp b/AST.cpp
index bcaae0e1..90b9962c 100644
--- a/AST.cpp
+++ b/AST.cpp
@@ -228,8 +228,8 @@ void UnaryOperation::checkTypeRequirements()
m_subExpression->checkTypeRequirements();
if (m_operator == Token::Value::INC || m_operator == Token::Value::DEC || m_operator == Token::Value::DELETE)
m_subExpression->requireLValue();
- m_type = m_subExpression->getType();
- if (!m_type->acceptsUnaryOperator(m_operator))
+ m_type = m_subExpression->getType()->unaryOperatorResult(m_operator);
+ if (!m_type)
BOOST_THROW_EXCEPTION(createTypeError("Unary operator not compatible with type."));
}