Replies: 3 comments 5 replies
-
@sotteson1 @kennykerr @AArnott @marler8997 for their thoughts. |
Beta Was this translation helpful? Give feedback.
1 reply
-
In cases like this where there is only a single field and that single field is an anonymous union I think it would be safe to unroll it such that the surrounding type has the layout of the anonymous union. So this: struct TYPE {
union {
bool a;
int b;
};
}; Becomes this: union TYPE {
bool a;
int b;
}; In Rust, the former requires |
Beta Was this translation helpful? Give feedback.
4 replies
-
Duplicate of #99 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Take a struct like
BLUETOOTH_ADDRESS
:This is converted in metadata to this (C# representation):
I presume a name (
Anonymous
) is required in ECMA-335 metadata, but of course that means that by default a projection's code has to write something like:By contrast, in a struct like
CHAR_INFO
, the union is intended to be explicitly declared, yet there's no metadata difference between these two structs.Is there a way we can mark anonymous nested unions like this so that the projection code knows that the
Anonymous
is really a non-identifier? What do other projections do here?Beta Was this translation helpful? Give feedback.
All reactions