Bad formatting of layout string for structs with nested anon structs/unions

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • None
    • Affects Version/s: None
    • Component/s: tools
    • None

      Consider this header:

      ```
      struct Foo {
          struct {
              int x;
              union {
                  int y;
                  int z;
              };
          };
      };
      ```

      Jextract generates this:

      ```
      private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
              MemoryLayout.structLayout(
              foo_h.C_INT.withName("x"),
              MemoryLayout.unionLayout(
              foo_h.C_INT.withName("y"),
              foo_h.C_INT.withName("z")
          ).withName("$anon$7:9")
          ).withName("$anon$5:5")
          ).withName("Foo");
      ```

      As it can be seen, the nested anon layouts are not indented as they should and this causes the layout declaration to be not very readable.

            Assignee:
            Maurizio Cimadamore
            Reporter:
            Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: