diff --git a/AST.cpp b/AST.cpp index dfb677f7e..0ec0eb0cc 100644 --- a/AST.cpp +++ b/AST.cpp @@ -383,6 +383,8 @@ void VariableDefinition::checkTypeRequirements() BOOST_THROW_EXCEPTION(m_value->createTypeError("Invalid integer constant " + type->toString())); type = intType; } + else if (type->getCategory() == Type::Category::VOID) + BOOST_THROW_EXCEPTION(m_variable->createTypeError("var cannot be void type")); m_variable->setType(type); } }