mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #963 from guanqun/disallow-void-var
Disallow implicit declaration of void type.
This commit is contained in:
commit
16fc2d651e
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