aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-02-06 19:08:24 +0800
committerchriseth <c@ethdev.com>2015-02-06 19:08:24 +0800
commit16fc2d651e1a96e3f86d98a8b3fb1fa43c9b20c1 (patch)
tree0883099a967a50b4683bad4aeaabc7a588593910
parent59a390937637111ebdadf2d3af57122a10bdd012 (diff)
parent7267afff55957b6c8ef113a85e20474c923f795c (diff)
downloaddexon-solidity-16fc2d651e1a96e3f86d98a8b3fb1fa43c9b20c1.tar.gz
dexon-solidity-16fc2d651e1a96e3f86d98a8b3fb1fa43c9b20c1.tar.zst
dexon-solidity-16fc2d651e1a96e3f86d98a8b3fb1fa43c9b20c1.zip
Merge pull request #963 from guanqun/disallow-void-var
Disallow implicit declaration of void type.
-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);
}
}