From 5bdadff0d8a9c32745dd46aa639283718613efdc Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 15 Mar 2018 19:07:25 +0100 Subject: Fix detection of recursive structs. --- .../structs/recursion/multi_struct_composition.sol | 15 +++++++++++++++ .../syntaxTests/structs/recursion/parallel_structs.sol | 15 +++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 test/libsolidity/syntaxTests/structs/recursion/multi_struct_composition.sol create mode 100644 test/libsolidity/syntaxTests/structs/recursion/parallel_structs.sol (limited to 'test') 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. -- cgit