aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorChristian Parpart <christian@parpart.family>2018-06-06 17:15:22 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-06-14 07:24:43 +0800
commita211b8911885ded6ddcd4d7400994a85235fe8e4 (patch)
treede225bc1e0f6f0dc29ab7984088752106dbfe5cd /libsolidity
parent014bbc6c97a4abdf8eed5d0273d00c80308e355d (diff)
downloaddexon-solidity-a211b8911885ded6ddcd4d7400994a85235fe8e4.tar.gz
dexon-solidity-a211b8911885ded6ddcd4d7400994a85235fe8e4.tar.zst
dexon-solidity-a211b8911885ded6ddcd4d7400994a85235fe8e4.zip
Enforce disallowing empty structs
This patch enfoces an error when it encounters an empty struct, effectively eliminating the deprecation warning. Also adjust 419_interface_structs to explicitely test for (non-empty) structs, as this behaviour "may" change in the future.
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/analysis/SyntaxChecker.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/libsolidity/analysis/SyntaxChecker.cpp b/libsolidity/analysis/SyntaxChecker.cpp
index 396058f4..f234dcaf 100644
--- a/libsolidity/analysis/SyntaxChecker.cpp
+++ b/libsolidity/analysis/SyntaxChecker.cpp
@@ -276,14 +276,8 @@ 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())
- {
- if (v050)
- m_errorReporter.syntaxError(_struct.location(), "Defining empty structs is disallowed.");
- else
- m_errorReporter.warning(_struct.location(), "Defining empty structs is deprecated.");
- }
+ m_errorReporter.syntaxError(_struct.location(), "Defining empty structs is disallowed.");
+
return true;
}