[MDSAL-365] Codegen fails when a grouping contains an enumeration leaf Created: 25/Jul/18  Updated: 26/Jul/18  Resolved: 26/Jul/18

Status: Resolved
Project: mdsal
Component/s: Binding codegen
Affects Version/s: None
Fix Version/s: Fluorine

Type: Bug Priority: Highest
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

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.

 



 Comments   
Comment by Robert Varga [ 25/Jul/18 ]

The problem is that SpecialNextHopImpl does not have a corresponding type, which would expose the fact it inherits visibility from the grouping and hence import logic does not know to account for the shadowing.

Generated at Wed Feb 07 20:09:37 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.