Skip to content

Recursion in struct definitions #67

Open
@dddejan

Description

@dddejan

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 structs
  • test/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 indirection
  • test/libsolidity/syntaxTests/structs/recursion/struct_definition_indirectly_recursive_dynamic_array2.sol: same
  • test/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;
    }
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions