[MDSAL-458] Binding V1 fails to generate code with union leaf named same as parent Created: 24/Jun/19 Updated: 27/Jun/19 Resolved: 27/Jun/19 |
|
| Status: | Resolved |
| Project: | mdsal |
| Component/s: | Binding codegen |
| Affects Version/s: | 3.0.8, 4.0.2 |
| Fix Version/s: | 3.0.9, 4.0.3 |
| Type: | Bug | Priority: | Medium |
| Reporter: | Juraj Veverka | Assignee: | Robert Varga |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Description |
|
Some combinations of nested leafs and unions causes generation of invalid binding code. Reproduced with neon and sodium releases.
|
| Comments |
| Comment by Robert Varga [ 25/Jun/19 ] |
|
Minimal test case: choice exported {
// implies 'case exported-to'
leaf exported-to {
type union {
type enumeration {
enum "netconf";
enum "cli";
}
type string;
}
}
}
i.e. we are in ExportedTo case and are attempting to create ExportedTo nested class, which is not allowed by JLS.
|
| Comment by Robert Varga [ 26/Jun/19 ] |
|
This also affects type bits and is not specific to choice/case, as the following fails, too:
container exported-to {
leaf exported-to {
type union {
type enumeration {
enum "netconf";
enum "cli";
}
type string;
}
}
}
|