mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Still allow empty structs for non-0.5.0 mode
This commit is contained in:
@@ -258,7 +258,14 @@ bool SyntaxChecker::visit(VariableDeclaration const& _declaration)
|
||||
|
||||
bool SyntaxChecker::visit(StructDefinition const& _struct)
|
||||
{
|
||||
bool const v050 = m_sourceUnit->annotation().experimentalFeatures.count(ExperimentalFeature::V050);
|
||||
|
||||
if (_struct.members().empty())
|
||||
m_errorReporter.syntaxError(_struct.location(), "Defining empty structs is disallowed.");
|
||||
{
|
||||
if (v050)
|
||||
m_errorReporter.syntaxError(_struct.location(), "Defining empty structs is disallowed.");
|
||||
else
|
||||
m_errorReporter.warning(_struct.location(), "Defining empty structs is deprecated.");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user