aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AST.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/AST.cpp b/AST.cpp
index d1c7d537..156d51f2 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);
}
}