Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8252799

Jextract can not handle multiple fields with inline type declarations that have the same name

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Cannot Reproduce
    • Affects Version/s: repo-panama
    • Fix Version/s: None
    • Component/s: tools

      Description

      For instance this header file:

          struct Foo {
              struct {
                  int x;
                  int y;
              } x;
          };

          struct Bar {
              struct {
                  int z;
              } x;
          };

      jextract running in source mode will only generate one layout field:

          static final MemoryLayout x$struct$LAYOUT_ = MemoryLayout.ofStruct(
              C_INT.withName("x"),
              C_INT.withName("y")
          );

      That is then referenced for both fields.

      While the fields have the same names, the layouts are unrelated, so 2 layouts should be generated.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            jvernee Jorn Vernee
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: