mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
disallow declaration of void type
https://www.pivotaltracker.com/n/projects/1189488/stories/86318578
This commit is contained in:
parent
e86c4602c5
commit
7267afff55
2
AST.cpp
2
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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user