Uploaded image for project: 'mdsal'
  1. mdsal
  2. MDSAL-361

Deal with restricted types in unions

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed
    • Medium
    • Resolution: Unresolved
    • None
    • 14.0.0
    • Binding codegen
    • None

    Description

      A typical example of a union which we do not handle correctly is:

          typedef pce-id {
              type union {
                  type binary {
                      length 4;
                  }
                  type binary {
                      length 16;
                  }
              }
          }
      

      These types are restricted and guaranteed not to overlap, but our current codegen rules silently squash them to a single field (first one wins, I think).

      There are multiple approaches we could take, like squashing the definitions, but that would only serve to confuse users – in this particular case they would be better served by generating encapsulated types for member – i.e. similar to what we do for enumerations.

      We need to figure out the naming here – as we cannot just take the 'binary' string – that would result in conflicting names. That naming clash needs to be figured out also for something like:

          typedef pce-id {
              type union {
                  type enumeration {
                      enum a;
                  }
                  type enumeration {
                      enum b;
                  }
              }
          }

       

      Attachments

        Issue Links

          # Subject Branch Project Status CR V

          Activity

            People

              Unassigned Unassigned
              rovarga Robert Varga
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: