diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-03-27 21:38:28 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-03-27 22:49:41 +0800 |
commit | b540ba527a70df440299de9c0bf44f9d11ac6ef6 (patch) | |
tree | e9a57df2cabfc118ba92f671d66f430c1936ec2c /test/libsolidity | |
parent | 62559cf1278afc417d19ec181e2bced364cadea2 (diff) | |
download | dexon-solidity-b540ba527a70df440299de9c0bf44f9d11ac6ef6.tar dexon-solidity-b540ba527a70df440299de9c0bf44f9d11ac6ef6.tar.gz dexon-solidity-b540ba527a70df440299de9c0bf44f9d11ac6ef6.tar.bz2 dexon-solidity-b540ba527a70df440299de9c0bf44f9d11ac6ef6.tar.lz dexon-solidity-b540ba527a70df440299de9c0bf44f9d11ac6ef6.tar.xz dexon-solidity-b540ba527a70df440299de9c0bf44f9d11ac6ef6.tar.zst dexon-solidity-b540ba527a70df440299de9c0bf44f9d11ac6ef6.zip |
Disallow empty structs
Diffstat (limited to 'test/libsolidity')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 2 | ||||
-rw-r--r-- | test/libsolidity/syntaxTests/empty_struct.sol | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index c5abac03..6163aed0 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -7279,7 +7279,7 @@ BOOST_AUTO_TEST_CASE(modifiers_access_storage_pointer) { char const* text = R"( contract C { - struct S { } + struct S { uint a; } modifier m(S storage x) { x; _; diff --git a/test/libsolidity/syntaxTests/empty_struct.sol b/test/libsolidity/syntaxTests/empty_struct.sol new file mode 100644 index 00000000..87bc2ffe --- /dev/null +++ b/test/libsolidity/syntaxTests/empty_struct.sol @@ -0,0 +1,5 @@ +contract test { + struct A {} +} +// ---- +// SyntaxError: Defining empty structs is disallowed. |