aboutsummaryrefslogtreecommitdiffstats
path: root/AST.cpp
diff options
context:
space:
mode:
authorLu Guanqun <guanqun.lu@gmail.com>2015-02-06 07:44:38 +0800
committerLu Guanqun <guanqun.lu@gmail.com>2015-02-06 07:49:05 +0800
commit7267afff55957b6c8ef113a85e20474c923f795c (patch)
treef805a3e8383ec1ba90cbfe1a9e24c17bb5386ca1 /AST.cpp
parente86c4602c583696a466da5b431c8f5c8e8e98217 (diff)
downloaddexon-solidity-7267afff55957b6c8ef113a85e20474c923f795c.tar.gz
dexon-solidity-7267afff55957b6c8ef113a85e20474c923f795c.tar.zst
dexon-solidity-7267afff55957b6c8ef113a85e20474c923f795c.zip
disallow declaration of void type
https://www.pivotaltracker.com/n/projects/1189488/stories/86318578
Diffstat (limited to 'AST.cpp')
-rw-r--r--AST.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/AST.cpp b/AST.cpp
index dfb677f7..0ec0eb0c 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);
}
}