Annotate struct definitions with a recursive flag.

This commit is contained in:
Daniel Kirchner
2020-04-16 16:42:12 +02:00
parent 95349b3634
commit df1809f8da
13 changed files with 210 additions and 133 deletions
+1
View File
@@ -184,6 +184,7 @@ BOOST_AUTO_TEST_CASE(type_identifiers)
BOOST_CHECK_EQUAL(ContractType(c, true).identifier(), "t_super$_MyContract$$$_$2");
StructDefinition s(++id, {}, make_shared<string>("Struct"), {});
s.annotation().recursive = false;
BOOST_CHECK_EQUAL(s.type()->identifier(), "t_type$_t_struct$_Struct_$3_storage_ptr_$");
EnumDefinition e(++id, {}, make_shared<string>("Enum"), {});
@@ -0,0 +1,10 @@
pragma experimental ABIEncoderV2;
contract C {
struct S {
uint a;
function() external returns (S memory) sub;
}
function f() public pure returns (S memory) {
}
}
// ----
@@ -4,4 +4,3 @@ contract C {
}
// ----
// TypeError: (37-64): Data location must be "memory" for parameter in function, but "storage" was given.
// TypeError: (37-64): Internal type cannot be used for external function type.
@@ -4,4 +4,3 @@ contract C {
}
// ----
// TypeError: (57-84): Data location must be "memory" for return parameter in function, but "storage" was given.
// TypeError: (57-84): Internal type cannot be used for external function type.