Details
-
Bug
-
Status: Confirmed
-
Medium
-
Resolution: Unresolved
-
None
-
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
Gerrit Reviews
| # | Subject | Branch | Project | Status | CR | V |
|---|---|---|---|---|---|---|
| 76057,4 | MDSAL-361: Deal with restricted types in unions | master | mdsal | Status: MERGED | +2 | +1 |
| 76644,1 | Revert "MDSAL-361: Deal with restricted types in unions" | master | mdsal | Status: MERGED | +2 | +1 |