solidity
solidity copied to clipboard
Recursion in struct definitions
trafficstars
In many syntax examples there are recursive struct definitions where we currently fail with a segmentation fault.
test/libsolidity/syntaxTests/parsing/mapping_in_struct.sol: mapping value type is the structure containing the mapping
contract test {
struct test_struct {
address addr;
uint256 count;
mapping(bytes32 => test_struct) self_reference;
}
}
test/libsolidity/syntaxTests/parsing/mapping_in_struct.sol: struct contains an array of structstest/libsolidity/syntaxTests/structs/recursion/struct_definition_directly_recursive_dynamic_array.sol: same
contract Test {
struct MyStructName {
address addr;
MyStructName[] x;
}
}
test/libsolidity/syntaxTests/structs/recursion/struct_definition_indirectly_recursive_dynamic_array1.sol: similar but with indirectiontest/libsolidity/syntaxTests/structs/recursion/struct_definition_indirectly_recursive_dynamic_array2.sol: sametest/libsolidity/syntaxTests/structs/recursion/struct_definition_indirectly_recursive_dynamic_array3.sol: same
contract Test {
struct MyStructName1 {
address addr;
uint256 count;
MyStructName2[] x;
}
struct MyStructName2 {
MyStructName1[] x;
}
}