diff options
author | Lu Guanqun <guanqun.lu@gmail.com> | 2015-02-06 07:44:38 +0800 |
---|---|---|
committer | Lu Guanqun <guanqun.lu@gmail.com> | 2015-02-06 07:49:05 +0800 |
commit | 7267afff55957b6c8ef113a85e20474c923f795c (patch) | |
tree | f805a3e8383ec1ba90cbfe1a9e24c17bb5386ca1 /AST.cpp | |
parent | e86c4602c583696a466da5b431c8f5c8e8e98217 (diff) | |
download | dexon-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.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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); } } |