aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGav Wood <g@ethdev.com>2015-06-19 10:17:45 +0800
committerGav Wood <g@ethdev.com>2015-06-19 10:17:45 +0800
commit93a6f63669465ed277335cb346948fb50814e67f (patch)
treefb88c99128af351d722d0c1bdee84962ec769670
parent4f52ad7e5bf545d1a8fe57bac44121aeda70ae4b (diff)
parent4adc684939924da25bebdae427e5bc789e93b0c4 (diff)
downloaddexon-solidity-93a6f63669465ed277335cb346948fb50814e67f.tar.gz
dexon-solidity-93a6f63669465ed277335cb346948fb50814e67f.tar.zst
dexon-solidity-93a6f63669465ed277335cb346948fb50814e67f.zip
Merge pull request #2235 from chriseth/sol_fix_recursiveStructs
Fix and test for not really recursive structs.
-rw-r--r--libsolidity/SolidityNameAndTypeResolution.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/libsolidity/SolidityNameAndTypeResolution.cpp b/libsolidity/SolidityNameAndTypeResolution.cpp
index fced1284..afa8b727 100644
--- a/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -190,6 +190,17 @@ BOOST_AUTO_TEST_CASE(struct_definition_indirectly_recursive)
BOOST_CHECK_THROW(parseTextAndResolveNames(text), ParserError);
}
+BOOST_AUTO_TEST_CASE(struct_definition_not_really_recursive)
+{
+ char const* text = R"(
+ contract test {
+ struct s1 { uint a; }
+ struct s2 { s1 x; s1 y; }
+ }
+ )";
+ BOOST_CHECK_NO_THROW(parseTextAndResolveNames(text));
+}
+
BOOST_AUTO_TEST_CASE(struct_definition_recursion_via_mapping)
{
char const* text = "contract test {\n"