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

Codegen fails when a grouping contains an enumeration leaf

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Highest Highest
    • Fluorine
    • None
    • Binding codegen
    • None

      This showed up in https://git.opendaylight.org/gerrit/74322 and boils down to:

      grouping special-next-hop-grouping {
          leaf special-next-hop {
              type enumeration {
                  enum blackhole {
                      description "Silently discard the packet.";
                  }
              }
          }
      }
      
      choice next-hop-options {
          case special-next-hop {
              uses special-next-hop-grouping;
          }
      }

      SpecialNextHopGrouping generates an inner enumeration class named SpecialNextHop. The case statement leads to SpecialNextHopBuilder being generated, which contains an inner SpecialNextHopImpl implementing SpecialNextHopGrouping.

      Since SpecialNextHopImpl implements SpecialNextHopGrouping, SpecialNextHop enumeration shadows the case statement, leading to mismatch in types when SpecialNextHop is used with a short name.

       

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

              Created:
              Updated:
              Resolved: