aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 9b97b916..07bf6759 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -6812,6 +6812,32 @@ BOOST_AUTO_TEST_CASE(skip_dynamic_types)
BOOST_CHECK(callContractFunction("g()") == encodeArgs(u256(7), u256(8)));
}
+BOOST_AUTO_TEST_CASE(skip_dynamic_types_for_structs)
+{
+ // For accessors, the dynamic types are already removed in the external signature itself.
+ char const* sourceCode = R"(
+ contract C {
+ struct S {
+ uint x;
+ string a; // this is present in the accessor
+ uint[] b; // this is not present
+ uint y;
+ }
+ S public s;
+ function g() returns (uint, uint) {
+ s.x = 2;
+ s.a = "abc";
+ s.b = [7, 8, 9];
+ s.y = 6;
+ var (x, a, y) = this.s();
+ return (x, y);
+ }
+ }
+ )";
+ compileAndRun(sourceCode, 0, "C");
+ BOOST_CHECK(callContractFunction("g()") == encodeArgs(u256(2), u256(6)));
+}
+
BOOST_AUTO_TEST_SUITE_END()
}