-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
None
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; } } }