aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-03-16 02:07:25 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-04-03 22:27:28 +0800
commit5bdadff0d8a9c32745dd46aa639283718613efdc (patch)
treee7661ff74a4620669381041a2f4c719d5abaa77f /test
parentc42caedec2b6dc2bfb268f538eecb1d4ee18f9d8 (diff)
downloaddexon-solidity-5bdadff0d8a9c32745dd46aa639283718613efdc.tar.gz
dexon-solidity-5bdadff0d8a9c32745dd46aa639283718613efdc.tar.zst
dexon-solidity-5bdadff0d8a9c32745dd46aa639283718613efdc.zip
Fix detection of recursive structs.
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/syntaxTests/structs/recursion/multi_struct_composition.sol15
-rw-r--r--test/libsolidity/syntaxTests/structs/recursion/parallel_structs.sol15
2 files changed, 30 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/structs/recursion/multi_struct_composition.sol b/test/libsolidity/syntaxTests/structs/recursion/multi_struct_composition.sol
new file mode 100644
index 00000000..9a1c22f1
--- /dev/null
+++ b/test/libsolidity/syntaxTests/structs/recursion/multi_struct_composition.sol
@@ -0,0 +1,15 @@
+pragma experimental ABIEncoderV2;
+
+contract C {
+ struct T { U u; V v; }
+
+ struct U { W w; }
+
+ struct V { W w; }
+
+ struct W { uint x; }
+
+ function f(T) public pure { }
+}
+// ----
+// Warning: Experimental features are turned on. Do not use experimental features on live deployments.
diff --git a/test/libsolidity/syntaxTests/structs/recursion/parallel_structs.sol b/test/libsolidity/syntaxTests/structs/recursion/parallel_structs.sol
new file mode 100644
index 00000000..d4ad088d
--- /dev/null
+++ b/test/libsolidity/syntaxTests/structs/recursion/parallel_structs.sol
@@ -0,0 +1,15 @@
+pragma experimental ABIEncoderV2;
+
+contract TestContract
+{
+ struct SubStruct {
+ uint256 id;
+ }
+ struct TestStruct {
+ SubStruct subStruct1;
+ SubStruct subStruct2;
+ }
+ function addTestStruct(TestStruct) public pure {}
+}
+// ----
+// Warning: Experimental features are turned on. Do not use experimental features on live deployments.